hyperlinks don't work when saving as PDF in Word 2007

S

Spacy Mike

I am trying to automate with VBA what I have been doing manually using Adobe
Writer. A contents page that has links to other PDF's saved as PDF from Word
2007.

Problem is if I try to create the contents page in Word 2007, insert
hyperlinks to the external PDF's (in same folder) and save as PDF, the
hyperlinks don't work when opened in Adobe Reader. The path is always an
absolute path to a folder on my computer, not the current folder (relative)
where the contents file is located. The links don't open the external PDF in
the same window, instead it first gave me a choice of open in browser or
Adobe. When I select Adobe, it says it can't find the file (absolute path to
where the files were first created, even though the file is there and I open
the original file in the original location). Then it would only open in a
browser and give Adobe security warnings each time I click on a link.

If I were to remove the Word links, and manually create the links using
Adobe, everything works perfectly (links open external PDF's in same window
without Adobe security warning messages).

My question is: is there anyway in Word to create links to external PDF's,
then save the Word document as a PDF and have the new PDF function with the
external links identically to the way Adobe created links work?
 
G

Graham Mayor

In order to correctly create hyperlinks, using Adobe Acrobat, you need to
use the Word add-in to set up the links. Then it should work as you might
expect. You might be better asking in the Acrobat forum for information on
accessing the Acrobat Object Library from VBA.
If you create the PDF using the Office 2007 PDF add-in from Microsoft then
the links are also created, but this time you will get a security warning
when you open them.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Spacy Mike

The links always point to the absolute path when saving to PDF ("C:\Documents
and Settings\usera.TTR\My Documents\Pictures.PDF" instead of "Pictures.pdf").
Also, the hyperlink is converted into a world wide web link in the PDF that
Word creates. Adobe 4 comes up with an 'invalide URL' message, Adobe 9 comes
up with the security warning, then opens in a web browser.

The purpose of upgrading the whole company to Office 2007 is for us to be
able to create PDF files that link to other PDF files (this goes onto CD's
that we send our customers). We want to get away from manually editing the
PDF links with Adobe. We want to use Office 2007 as a replacement of Adobe
Writer.

Is there anyway to tell Word, or any other Office app, to create the
hyperlinks as specific (non www) links to files, that will carry over to the
PDF that is created? Is there another way I can insert a link to a file in
Word (other than hyperlink) that will convert to a file link in the PDF?
 
G

Graham Mayor

The rudimentary Office 2007 PDF add-in from Microsoft, always seems to
create absolute paths. Acrobat 8's Office add-in does not - though you would
probably need to set Word Options > Advanced > Web Options > Files > uncheck
Update links on save (as Acrobat requires the document to be saved) in order
to preserve your relative paths. Testing here with hyperlinks pointing to
PDF files in the same folder, the resulting PDF will still open the linked
PDFs, if they are together moved to another folder - which I believe is the
object of the exercise?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Spacy Mike

I tried moving the PDF's to different folder, and the PDF treated the links
as relative paths, so that problem is fixed. Acrobat 9 interprets relative
path links as absolute path (to the same relative path) that was the
confusion I was getting when Acrobat 9 displayed the absolute path in the
security warning.

However, the readers still looks at the link as a web link, instead of a PDF
file link. Acrobat 9 opens the PDF in a web browser with the security
warning. Acrobat 4 comes up with an error message "Invalid URL". Opening in
Adobe Writer 4, and editing the link, indeed shows that the link is a web
link.

If the link is a bookmark on the same page, Acrobat 4 will go to a bookmark
on the same page without error and Acrobat 9 will do the same without the
security warning.

Is there anyway to create either a hyperllink, or some other type of link
that gets converted to a file link when saving as PDF?
 
G

Graham Mayor

I can't reproduce that problem. I suspect that it is caused by the windows
file association for PDF which appears to be currently set to Internet
Explorer and not to Acrobat/Reader.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

Jamie Dupee

I have been working with this same problem for over a year now.

A hyperlink within the adobe PDF framework has the property “Link
Properties†this can be set to "Open a web link", “JavaScriptâ€, “Submit Formâ€
or "Open File" etc..
When programmatically using the Word Framework to convert a Docx to PDF, all
“Word hyperlinks to external files†have their “Link Properties†property
defaulted to "Open a web link"..

I have experimented and cannot change the “Link Properties†by altering the
relevance to the windows file association for PDF!

I also wish I could find a “Word hyperlink†property called “Link
Properties†which could be set to “Open File".

I have got around the link relative path issue by building the .xml
component files of the Docx programmatically (the most important being the
document.xml , and .rels) , then zip all the files back into the Docx file.

Jamie Dupee

My web site http://www.edocuments.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top