PDA

View Full Version : Add a comment in the document when a broken link is found



bluedolphin
12-20-2017, 01:41 PM
Hello,
I am trying to write a macro that will find a broken link in a word document and automatically add a comment to that link saying "High: Broken Link".
Thanks in advance

macropod
12-21-2017, 09:05 PM
It's not apparent to me how Word would recognise a 'broken' link. Besides which, you don't say what kind of link it might be (e.g. hyperlink, OLE link, cross-reference, or even an out-of-date TOC entry).

bluedolphin
12-22-2017, 06:11 AM
I apologize Paul. I meant to write hyperlink

bluedolphin
12-29-2017, 07:45 AM
I am looking for a macro code for MS word which will validate all the hyperlinks in the word document and the ones that fail to take me to correct website , a comment saying "Link doesn't work" should be automatically added in the document.

macropod
12-31-2017, 04:37 PM
Word can't do that - you'd have to automate IE, for example, and use that to test each of the Word hyperlinks. I'm not sufficiently well versed in IE
automation for that.

macropod
01-01-2018, 02:02 PM
Cross-posted at: https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-msoffice_custom-mso_2013_release/validate-hyperlinks-in-a-word-document-macro-code/13551b36-6c3d-46ed-9b98-466dc18e4da8?auth=1
Please read VBA Express' policy on Cross-Posting in item 3 of the rules: http://www.vbaexpress.com/forum/faq.php?faq=new_faq_item#faq_new_faq_item3