Since upgrading to version 4.0, the concatenate option no longer works when encrypting the PDF. The following VB6 pseudo-code has worked for all versions until 4.0, but now results in a PDF that can't be opened. What changed? Thanks.
Set WordApp = CreateObject("Word.Application")
Set PdfApp = CreateObject("CDIntfEx.Document.4")
PdfApp.DriverInit("ADW PDF")
PdfOptions = (&H1) ' NoPrompt
PdfOptions = PdfOptions + (&H2) ' Use file name in DefaultFileName
PdfOptions = PdfOptions + (&H100) ' 40bit
Permissions = -64
Permissions = Permissions + 4
mPdfApp.OwnerPassword = PasswordOwner
mPdfApp.UserPassword = PasswordUser
mPdfApp.Permissions = Permissions
Call PdfApp.SetDefaultConfig
PdfApp.FileNameOptionsEx = PdfOptions
PdfApp.DefaultFileName = FileNameOutput
Call PdfApp.EnablePrinter(Company, CompanyCode)
Call PdfApp.CaptureEvents(True)
DocIdx = 0
For Each FileName In FileNameInput
DocIdx = DocIdx + 1
If (DocIdx > 1) Then
PdfApp.FileNameOptionsEx = PdfOptions + (&H4) ' Concatenate output
End If
Call PdfApp.EnablePrinter(Company, CompanyCode)
WordApp.Wordbasic.FilePrintSetup Printer:="ADW PDF", DoNotSetAsSysDefault:=1
Set WordDoc = WordApp.Documents.Open(FileName, False, True)
WordDoc.PrintOut Copies:=Copies
Next FileName