Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word to PDF via VBA (dead hyperlinks)

Status
Not open for further replies.

ETID

Programmer
Jul 6, 2001
1,867
US
Hello fellow tek-tippers,

The following code creates a post script file from select pages of a word document that I can then open (manualy), with the acrobat distiller within the adobe acrobat 6.0 .exe, and step through the "make pdf process" but all hyperlinks are ignored.

So two questions ...

Is there a way/method that will retain the hyperlinks and if so...
is there a way to do this all via VBA code ...maybe by passing the post script phase or by running yet another procedure to create the final PDF from the post script file?


Sub pdf_test()
ActivePrinter = "Adobe PDF"
Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, outputfilename:="i:\test_pdf_2.ps", Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="2-2", PageType:= _
wdPrintAllPages, ManualDuplexPrint:=False, Collate:=True, Background:= _
False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, _
PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
End Sub
 
Doesn't have Acrobat a virtual printer like PDFwriter ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for the response.

Yes it does have a "pdfwriter" in ealier versions and I installed it from ver 4.0, the problem is that when the code
calls the pdfwriter it creats a pdf document, but the hyperlinks are inactive.

subsequently if I call the "Adobe pdf" driver, the code creates the doc in a post script format, with the same omission of the hyperlinks when converted to pdf via the "distiller".
 
Hi ETID,

Embedded links (eg; you highlight some text, press CTRL-K, and bind the selected text to a URL, then display something like 'click me' as the text for the link) don't function in PDFs. Although the text will appear blue and underlined in the PDF, as it does in Word, clicking on the link will not function in the PDF document.

However, if your Word document contains an *explicit* link (eg: in your document, PDFMaker will convert it properly.

Cheers
 
Thanks macropod...

I guess I'm still a lttle fuzzy about "Distiller" vs "pdfmaker" vs "Adobe PDF virtual printer" vs "pdf writer".

the addresses in the links are to other pdf's in an ftp server folder...
I.E.
"ftp://my_ftp_server/path/linked_doc.pdf"

So if "pdfmaker" is the "engine" that I need to call, can it be manipulated with vba code similar to that which almost works as posted above?

Note that this code produces a post script file.
in addition, calling the "PDF writer" from ver 4.0, I am able to generate a pdf in one fell swoop, but still no active links as you describe.

Thanks for your thoughts so far.....


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top