Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Create and manage a collection (portfolio) using VBA (on Excel)

New Here ,
Oct 04, 2016 Oct 04, 2016

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

TOPICS
Acrobat SDK and JavaScript
2.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2016 Oct 04, 2016

The Acrobat SDK is very rich and complex, the chances of just "finding" code rather than writing it after detailed study of the SDK are small. Be sure it's the Acrobat X SDK you are using, don't download the latest. There is an Acrobat SDK forum here Acrobat SDK

It isn't clear whether you've copied and pasted someone else's file name into your code, or whether you have changed it to the correct DIPath form of file names you actually have.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 04, 2016 Oct 04, 2016

Hi try67,

Thanks for the update and moving the question.

It is actually a code I found online. I'm really not used to work with adobe on vba. However the DIPaths are the one where my files are. One of the problems I think is that the created collection is going in the Temp file which is not accessible to me (network...).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 04, 2016 Oct 04, 2016

[Question moved to the Acrobat SDK forum]

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2016 Oct 04, 2016

So, the multipart name IFC1...ADMIN.CH is an SMB server name? I ask because it looks as if you may be trying to load from a web or intranet site.

In any case get it working first with files in your desktop, using a suitable DIPath for that eg /C/USERS/...

And you seem to be saying you haven't downloaded and installed the SDK. Please do so.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 04, 2016 Oct 04, 2016

Unfortunately my company doesn't allow to dl and install programs... I will do it on my private computer but I don't have the same version of excel and adobe at home...

Yes everything is on a server (intranet).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2016 Oct 04, 2016
LATEST

The SDK is not a program. It is the documentation and information that all programmers must have. It is almost impossible to help people who do not have the SDK, because it is not our job to read the documentation for you, sorry!

What kind of server? Unfortunately people use "intranet" to mean different things. You CANNOT use a web address. This must be an SMB server, and the DIPath makes it look as if it is a web address.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines