Group: microsoft.public.word.vba.general
From: =?Utf-8?B?R2FiZQ==?=
Date: Friday, March 21, 2008 12:59 PM
Subject: Re: Clear Bookmarks

Yes, I have done that already, but I was hoping to create a button on the
template document that will clear the fields for me. That way I don't have to
keep reopening a new template every time. Sorry I am rather lazy. I tried to
run some code that would empty the undo cache but every time I click on the
command button it doesn't work? However when I manually walk through the code
by pressing F8 it works? What is with the command button??? Here is an
example, assign it to a command button:

Private Sub cmdNew_Click()
Do
ActiveDocument.Undo (1)
Loop While ActiveDocument.Undo = True
End Sub

"Jay Freedman" wrote:

> On Thu, 20 Mar 2008 13:36:01 -0700, Gabe wrote:
>
> >Is there anyway to delete all the text after a bookmark in a document? Kinda
> >like if you started at the bookmark and then pushed Shift+End on your
> >keyboard, and then Delete.
> >
> >Or even better,
> >
> >Is there anyway to undo all the update fields (bookmarks) at once , through
> >vb?
>
> Better than that: Save the unchanged document as a template (.dot file) and base
> new documents on it through the File > New command. Every time you start a new
> document, the fields will be empty. After they're filled in, you can save the
> document, or print it and then close it without saving.
>
> --
> Regards,
> Jay Freedman
> Microsoft Word MVP FAQ: http://word.mvps.org
> Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
>

Safety Articles | Usenet Groups | Usenet News | Bluegrass