Create and manage a collection (portfolio) using VBA (on Excel)
Hi,
I've been lloking for days but still don't have the answer... so I ask.
I have an excel macro which generate 15 different PDF files. I want to merge them in one collection (portfolio) at the end o the macro. The only code which I found is the following:
Sub createPortfolio2()
Dim AcroApp As Acrobat.CAcroApp
Dim Doc As Acrobat.CAcroPDDoc
Dim jso As Object
Set AcroApp = CreateObject("AcroExch.App")
Set Doc = CreateObject("AcroExch.PDDoc")
Doc.Create
Set jso = Doc.GetJSObject
'below is the actual code which creates the portfolio ("collection" in adobe parlance)
Set Collection = jso.app.newcollection()
'to add documents to your new portfolio, use the importdataobject method, I'm 90% sure the file path has to be formatted with the adobe / marks
If Collection.importdataobject(cName:="001.pdf", cDIpath:="//IFC1.IFR.INTRA2.ADMIN.CH/Shares/Organisation/LBA-ALCG-RE/11_Monitoring-controlling/00_SCA Controlling/Impression/001.pdf") = True Then
MsgBox "You should see your portfolio now!"
End If
Collection.saveas(“//IFC1.IFR.INTRA2.ADMIN.CH/Shares/Organisation/LBA-ALCG-RE/11_Monitoring-controlling/00_SCA Controlling/Impression/001.pdf”)
AcroApp.Close
End Sub
it stops working at the line "If Collection.importdataobject" with error 448 argument cannot be found. the saveas function doesn't work neither...
Any help is welcome
PS I'm working with adobe acrobat X Pro and excel 2010