I'm trying to achieve this: Lotus Notes creates a Word Document from a template, fills it with values from a Lotus Notes Database. The new Word doc is saved in the user's temp directory. Then a PDF is created in the temp directory from this word document which in turn will be further processed. All this shall happen without user interaction.
But PDF Converter keeps asking for a filename for the PDF. This is my code:
Code: Select all
(left out a few lines - worddoc, a word object is created and modified here)
pdfname = v_docspath & "\" & Strleftback(v_vorschlag, ".") & ".pdf"
'e.g. "C:\Daten\A85275\TEMP\20081217-TI20-24771-172074149-100-400201.pdf"
'I checked the dir (existing and writable) and the name (valid)
ActivePrinter = word.ActivePrinter 'save the currently set printer
word.Activeprinter = "PDF Converter" 'set PDF Converter
Set pdfprinter = createobject ("CDIntfEx.CDIntfEx") 'object in NotesScript
pdfprinter.DriverInit "PDF Converter"
pdfprinter.EnablePrinter "My Client's name", "their registration code"
pdfprinter.FileNameOptionsEx = 1 + 2 ' NoPrompt + UseFileName
' The output file name defined by the
' calling application per DefaultFileName
pdfprinter.FontEmbedding = True
pdfprinter.DefaultFileName = pdfname 'as define a few lines earlier
Print pdfprinter.DefaultFileName 'Debugging - should echo the pdf file name, echos nothing
worddoc.printout (False) 'This works, but asks for a name for the new pdf file
word.Activeprinter = ActivePrinter 'Reset to old standard printer
pdfprinter.DriverEnd 'Close PDF printer
worddoc.close 0 'Close word doc
(Code goes on some more lines)
Any idea what errors I made? Version is PDF Converter Pro 2.10e. Updating is not an option.
Thanks,
Stephan