Re: delete all bookmarks in file
- From: "Vince" <sdsad@xxxxxxx>
- Date: Sat, 16 Apr 2005 12:35:58 +0800
Should be (1).Delete and NOT (n).Delete. I thought it was a typo back then
until Jonathan corrected me.
****************************************
Dim n as Long
For n = 1 to ActiveDocument.Bookmarks.Count
ActiveDocument.Bookmarks(1).Delete
Next n
****************************************
"Jonas" <Jonas@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C76AA79C-5BAD-4496-B57C-B2E6753E7C9D@xxxxxxxxxxxxxxxx
> when I use this method for deleting all bookmarks, for some reason the var
n
> only goes up to half of the ActiveDocument.Bookmarks.Count total and then
> exits the loop. If I try to force the loop to calculate over half, it
shows
> the Bookmarks(n) to be invalid. anybody have any clues?
>
> Thanks alot,
> J.
>
> "Vince" wrote:
>
> > Ha ha! Typo!
> >
> > Dim n as Long
> > For n = 1 to ActiveDocument.Bookmarks.Count
> > ActiveDocument.Bookmarks(n).Delete
> > Next n
> >
> > "Jonathan West" <jwest@xxxxxxxx> wrote in message
> > news:uAS%23aIRGFHA.3120@xxxxxxxxxxxxxxxxxxxxxxx
> > >
> > > "Tony Logan" <TonyLogan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > > news:B317600F-95B3-4E9D-8047-5A828E3CBBA0@xxxxxxxxxxxxxxxx
> > > > Can a macro delete all bookmarks in a file? I want to be able to
delete
> > > > all
> > > > of them without knowing in advance how many there are, since the
number
> > > > will
> > > > vary from file to file.
> > > >
> > > > I'm using Word XP.
> > > >
> > >
> > > This will do the needful
> > >
> > > Dim n as Long
> > > For n = 1 to ActiveDocument.Bookmarks.Count
> > > ActiveDocument.Bookmarks(1).Delete
> > > Next n
> > >
> > >
> > > --
> > > Regards
> > > Jonathan West - Word MVP
> > > www.intelligentdocuments.co.uk
> > > Please reply to the newsgroup
> > >
> >
> >
> >
.
- References:
- Re: delete all bookmarks in file
- From: Jonas
- Re: delete all bookmarks in file
- Prev by Date: Re: Updating list from macro using form
- Next by Date: Re: How do I extract an embedded EXCEL worksheet from a word document.
- Previous by thread: Re: delete all bookmarks in file
- Next by thread: Macros in a Form
- Index(es):
Relevant Pages
|