Hi,
So someone has told me they were able to run the below vba code but since new Adobe got installed, it no longer works (it breaks at the line Set BookmarkRoot1 = jso1.BookMarkRoot)
I tried running the code on my machine and it breaks for me at a different line on PDFName1 = ThisWorkbook.Worksheets("Control").Range("PDFName1" saying it compile error cannot find the project or library.
Does anyone know the fix for this please?
Sub Combine()
Dim PDFDoc1 As Object
Dim PDFDoc2 As Object
Dim newPDF As Object
Dim BookmarkRoot1, BookmarkRoot2 As Object
Dim PDFPath, OutputPath As String
Dim jso1, jso2 As Object
Dim Item, SubItem, SubSubItem As Variant
Dim Item2, SubItem2 As Variant
Dim cell As Range
PDFPath = ThisWorkbook.Worksheets("Control").Range("PDFPath")
OutputPath = ThisWorkbook.Worksheets("Control").Range("OutputPath")
PDFName1 = ThisWorkbook.Worksheets("Control").Range("PDFName1")
PDFName2 = ThisWorkbook.Worksheets("Control").Range("PDFName2")
OutputName = ThisWorkbook.Worksheets("Control").Range("OutputName")
Set PDFDoc1 = CreateObject("AcroExch.PDDoc")
Set PDFDoc2 = CreateObject("AcroExch.PDDoc")
PDFDoc1.Open PDFPath & "\" & PDFName1 & ".pdf"
PDFDoc2.Open PDFPath & "\" & PDFName2 & ".pdf"
Set jso1 = PDFDoc1.GetJSObject
Set jso2 = PDFDoc2.GetJSObject
Set BookmarkRoot1 = jso1.BookMarkRoot
Set BookmarkRoot2 = jso2.BookMarkRoot
Set newPDF = CreateObject("AcroExch.PDDoc")
newPDF.Create
Thank You
Bookmarks