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.

File name options don't work

Postby joesse on Wed Dec 17 2008

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]
(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)
[/code]
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

Re: File name options don't work

Postby joesse on Mon Dec 22 2008

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.
joesse
 
Posts: 5
Joined: Mon Jul 21 2008
Location: Stuttgart, Germany

Re: File name options don't work

Postby Joan on Mon Dec 22 2008

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.
[size=150][color=#FF0000]Custom Brand the Amyuni PDF Printer Driver [/color][/size][color=#000080]http://www.amyuni.com/en/developer/branding/index.html[/color]

Amyuni PDF Converter tested for true PDF performance. View results - [color=#0040FF]http://www.amyuni.com/benchmark[/color]
Joan
Amyuni Team
 
Posts: 2799
Joined: Wed Sep 11 2002

Re: File name options don't work

Postby joesse on Tue Dec 23 2008

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!
joesse
 
Posts: 5
Joined: Mon Jul 21 2008
Location: Stuttgart, Germany

Re: File name options don't work

Postby Joan on Mon Dec 29 2008

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
[size=150][color=#FF0000]Custom Brand the Amyuni PDF Printer Driver [/color][/size][color=#000080]http://www.amyuni.com/en/developer/branding/index.html[/color]

Amyuni PDF Converter tested for true PDF performance. View results - [color=#0040FF]http://www.amyuni.com/benchmark[/color]
Joan
Amyuni Team
 
Posts: 2799
Joined: Wed Sep 11 2002


Return to Visual Basic Community

Who is online

Users browsing this forum: No registered users and 1 guest

cron