I am having problems writing to a single output file in a Citrix environment. I am concatenating MS Word and Excel files to a single PDF file. The problem seems to be isolated to the Word documents. The output file layout is created inside a loop, with the following order of documents: Word, Excel, Excel, Word, and Word. Below is the sample of code that I am using in the Word section and comments about the underlying environment.
Code: Select all
goWord.Documents.Open FileName:=sSourceFile, ConfirmConversions:=False
goWord.Options.PrintBackground = False
goWord.ActivePrinter = PDFPRINTERNAME
lRetVal = gPDFPrinter.Lock(sSourceFileName) ‘-- Returns 0
lRetVal = gPDFPrinter.SetDocFileProps(sSourceFileName, _
NoPrompt + UseFileName + EmbedFonts + Concatenate, _
"", _
sOutputFileName) ‘-- Returns 0
goPDFPrinter.EnablePrinter LICENSEDTO, ACTIVATIONCODE
HKEY_CURRENT_CONFIG\Software\Amyuni Document Converter\GeneratedFile value is equal to sOutputFileName
Code: Select all
goWord.ActiveDocument.PrintOut Background:=False, Range:=wdPrintAllDocument
HKEY_CURRENT_CONFIG\Software\Amyuni Document Converter\GeneratedFile value is changed to sSourceFileName after the user is prompted with the dialog box titled “Output File Nameâ€. This dialog box has a checkbox on it titled “Concatenateâ€.