The following code works perfectly in Microsoft excel VBA.
How can I change it to late binding?
Dim AcroPDDocNew As New Acrobat.AcroPDDoc Dim AcroPDDocAdd As New Acrobat.AcroPDDoc Dim lRet As Long lPages=0 lRet = AcroPDDocNew.Create() lRet = AcroPDDocAdd.Open("E:\Test1.pdf") lRet = AcroPDDocNew.InsertPages(lPages - 1, AcroPDDocAdd, 0, 1, True)
Isn't there really anyway for this?
Maybe nobody knows what BVA is.
Unfortunately this forum doesn't allow editing my post.
It was a mistype.
Though the title is mistyped, the contents of the question was correct.
It is VBA not BVA.
VBA is the visual basic language designed for Microsoft Office.
In any office project, if you press alt+F11, you'll be taken to a visual basic editor to write your code and execute a series of functions.
It's very similar to VB (Visual Basic .net) with some restrictions.
If nobody knows about VBA, then in VB is enough for me.
The question is:
How to late bind Acrobat object in VBA.
Yes, but now the typo is out there, you cannot make people read a post with a subject they do not understand by adding more replies. People use the subject to skip over posts. This is one occasion where I would advocate making a new post, even if others complain it is a duplicate.
You might also explain WHY you want late binding, whatever that is.
This is not, by the way, an especially busy forum. Replies may take a long time.
I took your advice and made a new post. Hope someone finds it.
Is there any way to ask a question directly from the developers?
I think if they sell something, they have to support the product or at least have enough documentation on the correct use of their product.
Thanks again for your time.
There was a time you could buy a developer support case for a few hundred dollars, but that seems to have gone away years ago. Do you actually have the documentation?
No, I'm looking for the documentaion.
The code you see in my first post above, was taken from a rondom site that came up with a google search.
I downloaded Acrobat SDK and searched it, but I couldn't find a good point to start there either.
The Acrobat SDK _is_ the documentation. That's all it is. There are thousands of pages. Tip: look for the "Interapplication communication" section, which is the one which covers OLE.
I've already seen that section. It doesn't talk about late binding.
Thank you for trying to help.
[Mistake in title fixed]
It's a shame not only Adobe sells a product and doesn't support the customers, but also doesn't offer enough documetaion on what they promis their software can do.
After days of trial and error, I end up to the following method. I'm not sure if it's the best way to do it, but in a world without documention, anything that works is correct.
The following code, creates a blank file, adds a page and saves it.
It's using Late Binding method.
Dim Ret As Long Dim AddAfter As Long Dim DocPageCount As Long Dim AcroApp As Object Dim ResultDoc As Object Dim AddThisDoc As Object Set ResultDoc = CreateObject("AcroExch.PDDoc") Set AddThisDoc = CreateObject("AcroExch.PDDoc") ' Create a blank pdf Ret = ResultDoc.Create() ' Add the first pdf AddThisDoc.Open ("D:\File2.pdf") If ResultDoc.InsertPages(AddAfter - 1, AddThisDoc, 0, AddThisDoc.GetNumPages(), True) = False Then MsgBox "Failed to Add " End If AddAfter = AddAfter + AddThisDoc.GetNumPages() AddThisDoc.Close ' Add second file AddThisDoc.Open ("D:\File2.pdf") DocPageCount = AddThisDoc.GetNumPages() If ResultDoc.InsertPages(AddAfter - 1, AddThisDoc, 0, DocPageCount, True) = False Then MsgBox "Failed to Add " End If ' save result If ResultDoc.Save(1, "D:\test.pdf") = False Then MsgBox "Failed to save the file." End If ResultDoc.Close
Thanks - a good working bit of code that should help me get over my own similar problem.