#1
|
|||
|
|||
Help with Word macro please
Hi,
I use this simple macro: Dim alink As Field For Each alink In ActiveDocument.Fields If alink.Type = wdFieldHyperlink Then alink.Unlink End If Next alink to remove all hyperlinks from a document. Now I need to remove only the hyperlinks with the word APPLE in the url, and leave the others alone -- how would I modify the macro?? Thanks for any help! |
#2
|
||||
|
||||
Hi Phil,
Try: Code:
Dim alink As Field For Each alink In ActiveDocument.Fields If alink.Type = wdFieldHyperlink Then If InStr(alink.Code.Text, "APPLE") > 0 Then alink.Unlink End If Next alink
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Appears to be working perfectly, thank you so much!!
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Print Macro in MS Word | steve207 | Word VBA | 0 | 09-10-2010 02:11 AM |
word macro username | Swarv | Drawing and Graphics | 4 | 06-16-2010 09:05 AM |
Word 2003 macro to Word 2007 to 2010 to... | maruapo | Word VBA | 0 | 06-04-2010 03:43 PM |
Word Macro Tutorial | Jax | Word VBA | 0 | 04-27-2010 09:13 PM |
Word macro | weezypenguin | Word | 0 | 02-25-2010 01:25 PM |