A family of Microsoft word processing software products for creating web, email, and print documents.
How do you "extract the raw link from the Field.Code property of a Hyperlink?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Split from this thread.
Thanks. ALT+F9 works great.
I have a document with a single relative link. Verified by using ALT+F9.
Is there a way I can "programmatically" view the links in a document.
I have tried using Word VBA but whenI look at the address field for the relative link, it shows an absolute address.
When I use C++ and the Word Document interfaces to look at the address field for the relative link, it shows an absolute address.
Daniel
A family of Microsoft word processing software products for creating web, email, and print documents.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
How do you "extract the raw link from the Field.Code property of a Hyperlink?
Thanks.
I've not worked with "Fields".
How do I "extract the raw link text from the Field.Code property"?
Could you reply with a code fragment?
I am implementing a program in C# but am familiar with VBA. So code in either language is great.
This used to be available via the Hyperlink.Address property in VBA. At some point the behavior changed so it always returns a fully resolved path, even for relative links. I know this because I recently had to fix a macro was crippled by the change.
The workaround I settled on was extracting the raw link text from the Field.Code property. Hyperlink objects are also Field objects.
Thanks ... again ... for quick reply
I did the previous reply in the old thread so that who sees the "programmatic" query has some context.
My project is a reasonably sized manual written in Word with lots of relative links. I have a C++ app I wrote that creates pdfs for all the Word files in case the reader doesn't have Word. That app also verifies all the links satisfy various criteria I have set. One is that the appropriate links are relative and "valid" so that the manual can be installed anywhere, i.e. the target of relative link is in the deliverable package.
Daniel
I've split your new question to a new thread to ensure it receives attention.