File name options don't work

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
joesse
Posts: 5
Joined: Mon Jul 21 2008
Location: Stuttgart, Germany
Contact:

File name options don't work

Post by joesse »

Hi,

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)
When asking for a name for the pdf file, PDF Converter offers a default value, made of a directory which is neither the directory of the word document nor the temp directory nor word's standard doc directory, followed by word's document name with the .pdf extension.

Any idea what errors I made? Version is PDF Converter Pro 2.10e. Updating is not an option.

Thanks,
Stephan
joesse
Posts: 5
Joined: Mon Jul 21 2008
Location: Stuttgart, Germany
Contact:

Re: File name options don't work

Post by joesse »

Sorry, I have to bump this. I posted here because I think VBA is the closest to NotesScript. I think someone who understands VBA should be able to understand NotesScript.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Re: File name options don't work

Post by Joan »

Hello,

Your code is clear and one can understand it even if he/she doesn't know lotus Notes.

After your call to pdfprinter.DefaultFileName = pdfname please call pdfprinter.SetDefaultConfig()

If this didn't help please try to define your file name as "c:\Test.pdf" and check if it works.
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html

Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
joesse
Posts: 5
Joined: Mon Jul 21 2008
Location: Stuttgart, Germany
Contact:

Re: File name options don't work

Post by joesse »

I got it (well - I know why this won't work): users don't have write access to the registry key HKCC\Software. They should have that (or at least write access to HKCC\Software\PDF Converter) to make my code work. Unless you got a work around for this I will try to make my client's IT dept. to change the access level.

Thank you for your help!
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Re: File name options don't work

Post by Joan »

Hello,

You are right users need to have write access to at least the key of the PDF Converter in the registry otherwise your application will have no way to write to the registry.

This is not a bug or an error actually and it is related to Windows users rights over the registry.

Merry Christmas and Happy New Year
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html

Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Post Reply