Quantcast
Viewing all articles
Browse latest Browse all 73766

Multiple Bookmark pages using Excel VBA

Please help me mark mutiple bookmark finding single word in whole document.

 

I am using the below script for one bookmark.

 

Private Sub CommandButton1_Click()

Dim BM As AcroPDBookmark

Dim ADoc As AcroAVDoc
Dim PDoc As AcroPDDoc

Dim bFileOpen As Boolean
Dim btitle As Boolean
Dim strfile As String
Dim filn As String
Dim strB As String
Dim ACAPP As AcroApp


'Create the Acrobat Object
    Set ACAPP = CreateObject("AcroExch.App")
'Create Doc objects
    Set PDoc = CreateObject("AcroExch.PDDoc", "")
    Set ADoc = CreateObject("AcroExch.AVDoc", "")
bFileOpen = ADoc.Open("C:\Users\Desktop\AAAA.pdf", "")
             Set PDoc = ADoc.GetPDDoc
             'Create BookMark Object
             Set BM = CreateObject("AcroExch.PDBookmark")
             'Show the Application to be able to insert bookmark
             ACAPP.Show
            
btitle = ADoc.FindText("CUSTOMER NAME", False, True, True)
ACAPP.MenuItemExecute ("NewBookmark")

btitle = BM.GetByTitle(PDoc, "Untitled")
btitle = BM.SetTitle("Santosh")

 

PDoc.Save 1, "C:\Users\Desktop\aaaa.pdf"

ADoc.Close 0
PDoc.Close

 


    ACAPP.CloseAllDocs
    ACAPP.Exit
    Set ACAPP = Nothing
    ADoc.Close 0

 

End Sub

 

Kindly suggest ... this is required urgently


Viewing all articles
Browse latest Browse all 73766

Trending Articles