Doing it your way it seems that you have to wait for the collection to
"shuffle down" before removing the next link.
> For n = ActiveDocument.Range.Hyperlinks.Count Step -1
Should have been
For n = ActiveDocument.Range.Hyperlinks.Count ...TO 1... Step -1
Eddie
> *From:* "Doug Robbins - Word MVP"
> *Date:* Sat, 4 Aug 2007 07:09:18 +1000
>
> No, it will work.
>
> The following however
>
> Dim n As Long
> For n = 1 to ActiveDocument.Range.Hyperlinks.Count
> Activedocument.Range.Hyperlinks(n).Delete
> Next n
>
> would delete the first, then what was originally the third and then what
> was originally the seventh, etc until it errors out because n becomes
> greater than the number of paragraphs remaining in the document.
>
> That said however, I usually start from the .Count and step backwards
> through the collection when deleting items.
>
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "Edward Thrashcort"
> news:memo.20070803190932.5928G@eonsol.compulink.co.uk...
> >> Dim n As Long
> >> For n = 1 to ActiveDocument.Range.Hyperlinks.Count
> >> Activedocument.Range.Hyperlinks(1).Delete
> >> Next n
> >
> > Should that be
> >
> > For n = ActiveDocument.Range.Hyperlinks.Count Step -1
> > Activedocument.Range.Hyperlinks(n).Delete
> > Next n
> >
> >
> > Eddie
> >
> >> *From:* "Jonathan West"
> >> *Date:* Fri, 3 Aug 2007 18:08:39 +0100
> >>
> >>
> >> "Bugsy"
> >> news:%23YyOo%23e1HHA.3640@TK2MSFTNGP06.phx.gbl...
> >> >I have copied a document from the internet into a WORD document (WORD
> >> >2002). The copied document has hundreds of "hyperlinks" and
> > "Permalinks"
> >> in >it.
> >> >
> >> > How can I remove ALL the links at one time (from the entire copied
> >> > document)? It would take forever to eliminate each one separately, I
> >> > think.
> >> >
> >> > I am using Windows XP Home edition.
> >> >
> >> > Thanks for any suggestions.
> >> >
> >> >
> >> >
> >>
> >> Dim n As Long
> >> For n = 1 to ActiveDocument.Range.Hyperlinks.Count
> >> Activedocument.Range.Hyperlinks(1).Delete
> >> Next n
> >>
> >>
> >> --
> >> Regards
> >> Jonathan West - Word MVP
> >> www.intelligentdocuments.co.uk
> >> Please reply to the newsgroup
> >>
> >>
> >>
> >
>
>
>