These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Convert xls to pdf writing VB code containing bookmarks

Blue
Registered: Feb 27 2008
Posts: 3

I wrote VB code in excel to convert an xls workbook to pdf Acrobat 7. Also I have distiller 7 for convesion.
I use the commad printout to my code ! This works fine and the pdf is created succesfully. But I want the contents of the A1 cell to become bookmark in pdf file. In properties "Always add bookmarks to Adobe PDF" is checked.
If I do the Convertion manually by clicking in the icon "Convert to Adobe Pdf" convert workbook ok and also puts the contents of the A1 cell as bookmarks. I want the same thing to be done from the code. Am I using wrong command in my code that doesn't support bookmars ??

My Product Information:
Acrobat Standard 7.0, Windows
Bill_S
Registered: Mar 12 2008
Posts: 4
I am using Excel 2003 and Acrobat Pro v7.

I generate hundereds of pages in Excel using a VBA script and would also like to find a way to generate bookmarks; however, it appears that Acrobat will only create bookmarks from worksheet names - not very useful IMHO.

I found an Excel VBA script that takes the bookmark parameters from Excel and inserts the bookmarks into an existing PDF file. But it was written for v5 and doesn't work in v7. If anyone has a script that will work with v7, that would be great.

I am also looking at using a PDFMark script. Since I am not a postscript developer, I would prefer to modify an existing script. If someone has one, I would appreciate it. I would have close to 260 bookmarks so manually adding them would be way too tedious.

Hopefully, both of us will solicit a solution.
Thanks, Bill
Blue
Registered: Feb 27 2008
Posts: 3
Hi Bill_S
I would appreciate if you send me the code you said that create bookmarks from worksheet names because that I have now is ok with worksheet names instead of no bookmarks !!!
I am looking forward for your responce!
Thanks
Bill_S
Registered: Mar 12 2008
Posts: 4
Go to:
http://forum.planetpdf.com/
and the Developers forum and look for topic "Automating bookmarks"
and this info:
From: kammera
Date: Thursday, April 10, 2003 06:49 PM

The file name is AcroJSBookmarksVBA.zip

I am currently using my same VBA script that produces my output to generate a PDFMark file that will build the bookmarks.

In your case, you could read from cell A1 for each page and output to this file. When you output your main pages, print to a postscript file instead of using PDFMaker (note - not the same as PDFMark). Then use this PDFMark file that contains your bookmark parameters and to read your output file. It is this file that is distilled.

So far so good. I'm working out the details but my preliminary test results are encouraging.

Search the forum above for
Topic: Bookmark content from named file (1 of 2), Read 113 times
Conf: (P-PDF) General
From: spica
Date: Thursday, April 08, 2004 01:17 PM

I hope this helps, Bill