Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Clear Bookmarks

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gabe - 20 Mar 2008 21:36 GMT
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?
Gabe - 21 Mar 2008 01:03 GMT
Also, why is it that when I run a macro from a command button I can't undo
any of the previous actions?

> 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
[quoted text clipped - 4 lines]
> Is there anyway to undo all the update fields (bookmarks) at once , through
> vb?
Jay Freedman - 21 Mar 2008 02:21 GMT
>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
[quoted text clipped - 4 lines]
>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.
Gabe - 21 Mar 2008 18:59 GMT
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

> >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
[quoted text clipped - 15 lines]
> Microsoft Word MVP        FAQ: http://word.mvps.org
> Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
Doug Robbins - Word MVP - 22 Mar 2008 23:20 GMT
If you are using formfields, then have the code set the .Result property of
the formfield to ""

Signature

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

> 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
[quoted text clipped - 39 lines]
>> Email cannot be acknowledged; please post all follow-ups to the newsgroup
>> so all may benefit.
Tony Strazzeri - 24 Mar 2008 05:26 GMT
> That way I don't have to
> keep reopening a new template every time.

Hi Gabe,

What do you mean by this?
Why are you opening the template file at all?

The idea of a template file is that word creates a NEW DOCUMENT
document from the template.  ie .  if you double-click on the temlpate
file from Windows explorer  word will create a new  document from that
fil.

If the template is in the right place on your PC (ie in either of the
locations --"User Templates" or  "Workgroup Templates" pointed to in
"Tools|Options|File Locations" then it will appear when you select
File|New.  That will also make a new document from the temlpate.

What is hard about that? If you use the template all the time you can
create a simple macro to do the File|New and put that on a toolbar.

Hope this helps.

Cheers!
TonyS.
Jean-Guy Marcil - 24 Mar 2008 17:35 GMT
> 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
[quoted text clipped - 9 lines]
>     Loop While ActiveDocument.Undo = True
> End Sub

Kind of a strange way of doing things... But if you insist, the above code
should be repalced by:
   ActiveDocument.UndoClear

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.