Add bookmarks to PDF using VBA Excel

Good morning-

I have, through research on the internet, created an Excel macro that prints several workbooks to PDF, combines in a single file and print this file.  I searched for the last piece, which is adding bookmarks, but have had no luck getting it to work.  Here is the code I use to add bookmarks-

Dim avdoc, pddoc, app As Object
Dim stFile As String
Subtitles As Boolean Dim
Dim PDBookmark As CAcroPDBookmark

stFile = "D:\Test\Test.pdf."
Set app = CreateObject ("AcroExch.app")

Set avdoc = CreateObject ("AcroExch.AVDoc")
Set pddoc = CreateObject ("AcroExch.PDDoc")
pddoc. StFile open

Set avdoc = pddoc. OpenAVDoc (stFile)
Set PDBookmark = CreateObject ("AcroExch.PDBookmark", "")

App. MenuItemExecute ("NewBookmark")

subtitles = PDBookmark.SetTitle ("Test bookmark")

This code inserts a bookmark on the first page of the document.  The bookmark title appears as untitled instead of Test bookmark as indicated in the code.  Can someone answer the following questions -

1. why the code not change the Untitled Test highlighted bookmark bookmark, and

2. How will nodify code above to go to a certain page, then enter the bookmark.

Any help is greatly appreciated.  Thanks in advance for your time.

Hello

This discussion reminds me of a great example VBA of Jens Kammerath,

who also answer your next question = how to set bookmarks as a tree.

Also save some work and tests :-)).

You can download:

http://www.ReFob.de/downloads/Acrobat/AcroJsBookmarksVBA.zip

HTH, Reinhard

Tags: Acrobat

Similar Questions

  • Someone at - it a VBA Excel code saves a pdf file into a text file?

    I use Adobe Reader XI.  I have the directory on my HDD that has two files; the first is an Excel worksheet and the second is a file 'pdf' of Adode.  I wrote a code using VBA Excel that opens the pdf file.  I am looking for a procedure that would save the pdf file to a text file (for example, "*.txt").  So far I found the code to do this, but it is written for Adobe Professional.  Someone has the code that would do the same thing using Adobe Reader XI?

    Not possible with Adobe Reader.

  • How to add bookmark on iOS

    HelloW everyone,

    I was wondering for amd is it possible to add bookmark in PDF format on the iOS platform and synchronize to mobile devices?

    I'm about to buy acrobat lolo DC. Doest it provide these function?

    Hello

    Currently, Adobe Acrobat for iOS (free mobile app), Acrobat Reader (free desktop application) DC and Acrobat Pro DC (paid office application) do not support the user Favorites (i.e. custom bookmarks added to specific pages for each user).  Applications support only bookmarks "Table of contents" which are embedded in a PDF document.

    Although Acrobat for Android supports user bookmarks, syncing with the desktop app is not supported.

    Hope that clarifies it.

    Please let us know if you have any other questions.

  • I would like to add bookmarks, based on the name of the original file when combining PDFs using Javascript.

    I am combining hundreds of original 1-page PDF files in dozens of PDF files. I generated the JavaScript to do this. However, I would like to add bookmarks for some pages, based on the name of the name of the file from this page. Here is a sample of my script combining:

    var currDoc = app.openDoc ("C:/report/December 2015 / Insert Plan SD." "") "'PDF');

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015 / RPM RPM/K001. PDF"});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015 / output / K001 ROCHESTER."}) PDF"});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015 / Insert Plan.PDF '});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015 / RPM/L002 RPE."}) PDF"});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015 / output / L002 BOSTON."}) PDF"});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015/Maps/10_Map3.PDF"});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015/Maps/10_Map2.PDF"});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015/Maps/10_Map1.PDF"});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015 / Comp Brand/10_KReport1.PDF"});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015 / Comp Brand/10_LReport1.PDF"});

    currDoc.saveAs ({cPath: "C:/report/December 2015 / Final / 10 2015 Review.PDF area"});

    currDoc.closeDoc (true);

    Take a look on the Bookmark object and methods associated with it.

  • How nested bookmarks via VBA Excel

    Hi, I'm looking to accomplish a task using Microsoft Excel 2007, VBA and typotheque Adobe Acrobat 10.0. I am able to create bookmarks programmatically in a specified PDF but I would like to also nest these bookmarks programmatically. I think I can handle the designation of these groups (i.e. bookmarks fall into each of the headings of the nest) using VBA code, but I can't determine if there is no Adobe API to handle nesting. I looked through ' Communication monitor QAnywhere .

    " Kit SDK adobe® Acrobat®" - November 2006 - Version 8.0 but found nothing on this subject. I have Adobe Acrobat 9 installed on my machine.

    Any help is welcome.

    Gary

    Hello

    It is sometimes more I looked there are in this area. But if you use / google for "Bookmarks VBA Reinhard", you will find discussions for what you want to do.

    You can set bookmarks using Acrobat and VBA via:

    -using the PDFmark. Means: You write a file with bookmarks and Virgin, PS the placeholder pages, change via printer 'Adobe PDF' (distilling) in PDF format and replace the placeholder with your pages pages.

    -with the help of Acrobat JS via JS-object. If you create bookmarks via JS you must define an action (like: this.pageNum).

    Blows to the top of your size, which is very hard (if you delete a page, you must reset any bookmarks after). So for me it's not a real option.

    -If you set the bookmark via "Menuiteminsert" or "Sendkey ^ b ', as the method used, you can set 'natural' first level bookmarks and rearange them later in nested using bookmarks JS/JSO.

    To do this, I saved an example of "Jens Kammerath". If you contact me I can send it to you.

    Because all these methods are not real smart and Adobe seems not to be interested by this domain (no change since Version 4) personal I prefer freeware commandline tools like PDFTk, bookmarks. However, attached an example file PDFmark PS you can save and run (doubleclick).

    best regards, Reinhard

    BookmarkTest.ps

    ------------------------------------------------------------------------------------------ ----------

    %! PS-Adobe - 3.0
    % BeginProlog
    /pdfmark where {pop} ifelse {userdict /pdfmark /cleartomark load put}
    %% EndProlog

    % CROP PAGES
    [/ Pdfmark/pages CropBox [54 403 558 720]]

    Space reserved-Pages and bookmarks
    showPage [/ pdfmark/out/Page 1 2 title (mother) count]
    showPage [/ pdfmark/out/Page 2 count 1 title (child)]
    showPage [/ Page 3 count 0/title (child) / out pdfmark]
    showPage [/ pdfmark/out/Page 4 count 1 title (child)]
    showPage [/ Page 5 count 0/title (child) / out pdfmark]
    showPage [/ Page 6 count 0/title (mother) / out pdfmark]

  • How to convert pdf file to excel by using the export program?

    I BOUGHT THE EXPORT PROGRAM AMD TRIED THE COMVERSION.  I JUST BOTH IN EXCEL ANDD WORD RAGTIME.

    SHOULD WHAT PROGRAM I USE TO GET A SUCCESSFUL CONVERSION?

    PDF to Word, Excel or any other format conversion is one of the most complex things, you can try to do it with a PDF file. It works very well in some cases, in other cases, the output doesn't have much to do with the original file. The key to success is that the PDF file must be "marked" - which means that it contains information about the information displayed in the file. The best way to ensure that a PDF file is properly tagged is using the PDFMaker in Acrobat to create PDF from Word or Excel file (this is the Acrobat Ribbon or toolbar).

    Unfortunately it is not that you can do to improve the output without spending a lot of time (for example manually tracking file). In addition, because you use Adobe ExportPDF service and do not have access to Acrobat, it is even not an option.

    The only thing you can do is complain to the original author of the file and tell them that they used a PDF generator bad to create the PDF file.

  • Why does my bank statement appear garbled when I use the PDF export to Excel feature?  The properties of the document says ok to convert Adobe.

    I used a free trial version of Wondershare and the downloaded PDF beautifully.  A response to a question from Google suggested the rotation of the OCR, but is no longer an option?

    I am a subscriber of DC of Acrobat.  I used the PDF export to Excel export feature.  I did it by opening the PDF and choose the export option.  It is a PDF generated Bank from a client.  The text is composed of symbols for most.  It is a statement of Bank of America for a checking account.  The statements of his savings bank of America converted very well.  However, there was a different look between 2 PDF files.  Thanks for your help in advance!

  • When I try to sign and add dates in pdf forms, as I USED to be able to do...

    When I try to sign and add dates in pdf forms, as I USED to be able to do until I'm so-called 'improved', by selecting "fill and sign", the page will just blank and I'm drunk. What's wrong?

    Windows 7 Pro.

    Screenshot simply shows nothing else that a header with a tab said "Document" that would bring back me to the pdf document. All the pdf documents I've tried, and that was the most I've saved.

    Unfortunately, it came to my attention when I had little time and was both deal with the Australian Taxation office AND fill in the dates and sign and return that some docs of annual audit my accountants.

    Solved the problem simply uninstall the DC version and stalking a version of X Adobe Reader online and installation. Hey presto, everything fixed. As usual the lesson learned is: if it's not broken, don't fix it "." It happened because I agreed a recommended update. Like so many others, Adobe seems to have problems with the "newer".

    I now put on ' manually search for updates (so-called non recommended) and that's the way it will stay, and I do not seek. Also, if I try in the future, I keep the Setup program in a folder in my downloads, so I can come back easily, where an agency decides to remove older versions of availability.

  • How to copy paste an excel file to direct the PDF using a software or a command

    Hello

    I often use the excel and pdf file apparently, I need to open two files at the same time, I do just calculation in excel file and paste directly into PDF file.

    Please suggest me a software to use this utility.

    Please

    Hi Khateeb,

    You can use Adobe Acrobat DC, which provides you with the copy & paste feature mode Edit PDF or you can combine your Excel file with the PDF file.

    If you wish, you can try free trial 30 days of Adobe Acrobat DC Pro. Please refer to this link Download Adobe Acrobat free trial | Acrobat Pro DC

    Make sure you check the system requirements before downloading.

    If you have any other questions please let us know. We will be happy to help you.

    Kind regards

    Nicos

  • The pdf I want to change has all embedded fonts.  When I try to insert a comma, I get the message, "all or part of the selection has no available system fonts.» Cannot add or remove text using the selected font. "Will I still have this problem

    The pdf I want to change has all embedded fonts.  When I try to insert a comma, I get the message, "all or part of the selection has no available system fonts.» Cannot add or remove text using the selected font. "Will I still have this problem if I'm updating from Acrobat X?

    You have the fonts installed in the system. This has not changed. (Having the police is not always enough, but it is certainly necessary).

  • Smart view Ribbon not displayed when Excel is called using VBA

    Hyperion dear gurus,.

    I am in need to call refresh smartview by calling excel with VBA from excel module in another sheet (master). But when I invloke Excel using VBA, smartview Ribbon not be enabled, because of which the HypConnect, HypVMenuRefresh command does not work. If I open excel directly and run the module, it connects very well and did the update with no problems. I tried to activate and deactivate the smartview using VBA, but it does not work either. If I call excel directly using a batch by using the call command, then it works fine, but the batch file does not close as if I use the ThisWorkbook.Close command, then it does not completely close Excel, the instance is running, and if I try to close it using Application.Quit, then it closes Excel completely. Any help would be much appreciated.

    Thank you and best regards,

    SiddN.

    Hello

    I was able to achieve this goal by using batch files by calling a excel models.

    Thank you

    SiddN.

  • Can I add watermarks to PDF files using the PDF package?

    Can I add watermarks to PDF files using the PDF package?

    Hi Susannah,

    Adobe PDF Pack does not allow to edit a PDF file. To do this, you would need Acrobat. We invite you to try Acrobat free for 30 days: see http://www.adobe.com/products/acrobat.html for more information.

    This help document describes how to watermark a PDF in Acrobat: add watermarks to PDF

    Best,

    Sara

  • Use VBA and Excel to open Dreamweaver HTML (CS5), search and replace text, save and close

    I would use VBA and Excel programmatically open numbered Dreamweaver HTML (CS5) and find and replace text in the view code in these files, save and close them.

    I have 5000 associations between find: x 0001 and replace: y0001 in an Excel sheet.

    I have written VBA but do not know how to open, close and save the code in the .html files view. Please... and thank you...

    [email protected]

    I use ASP.net for backend coding, I use PHP. If you want to stay with Microsoft technologies, and then you would like to use ASP.net. and a Microsoft server.

    When you have a Web site that contains many pages with similar content structure, the practice is to store all content and all variables in a database. It is possible to create a site that has hundreds of 'pages', with many variations in the pages, so they don't all look like clones, and yet all this might be based on a single web page. A website as Amazon.com has millions of 'pages', but may actually have only a dozen basic page structures.

    Convert what you now have a system like this would be a fair amount of work, but it's the way to go now.

  • Convert Excel to PDF using specific fonts that before shift ends with missing text

    Hello, I hope someone can help out me.  I have a problem with the conversion of an Excel specific document to PDF using Acrobat 6.0.6.  Whenever this document is converted to PDF, on a specific computer, there are missing lines of text.  The text font is avant-garde.  I can change the font to something like Arial and it allows you to convert very well and all text will be shown in the PDF file.

    I have already reinstalled Windows on this PC with its strict necessary and of course the problem persists.

    The font of Vanguard is installed through Adobe Type Mangager Light 4.1.  The fonts are Post Script. PFB.  I have a second and third PC with the same configuration and these other two can convert Excel to PDF using Acrobat 6.0.6 with no problems (using the same Avant Garde font).

    I can uninstall and reinstall Acrobat 6.0.6 and this will fix the problem temporarily, but eventually he'll come back in a day or two.

    Is there anything that anyone can think that would cause this problem to occur?

    It is possible that you have to install the MS Hotfix here:

    http://support.Microsoft.com/kb/952909/en-us

  • How to judge if a PDF doc is with XFA by VBA Excel?

    Here is my code in VBA Excel, but there is an error: "run-time error '438': object doesn't support this property of method:

    Void IsXFA()

    Dim app, avdoc Object jso Object did Object, pageview As Object

    Set app = CreateObject ("AcroExch.App")

    Set avdoc = app. GetActiveDoc

    Define the jso = avdoc. GetJSObject

    If avdoc.dynamicXFAForm = True Then

    JSO. Console.println ("this is a dynamic XML form.")

    End If

    End Sub

    The GetJSObject method is available for a PDDoc, you get the corresponding to your AVDoc PDDoc and then get the JSObject.

Maybe you are looking for