Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
charles
 
Posts: n/a
Default How to save and return to position in document?

Using Word 2000, I need to run a macro that selects parts of a
document, does some reformatting, and returns to the original
position.

I just can't think of how to save and return to the original position
in Word.

If anyone can help, I would appreciate it a lot.

Thanks.

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill
 
Posts: n/a
Default How to save and return to position in document?

Have your macro set a bookmark at the starting position and return to it at
the end?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"charles" wrote in message
...
Using Word 2000, I need to run a macro that selects parts of a
document, does some reformatting, and returns to the original
position.

I just can't think of how to save and return to the original position
in Word.

If anyone can help, I would appreciate it a lot.

Thanks.


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Greg
 
Posts: n/a
Default How to save and return to position in document?

Charles,

Something like this:

Sub Scratchmacro()
'Create a bookmark at current selection point:
ActiveDocument.Bookmarks.Add Name:="tmpMark", Range:=Selection.Range
MsgBox "Do your thing here"
'When finished, go to the bookmark
Selection.GoTo what:=wdGoToBookmark, Name:="tmpMark"
'Kill the bookmark
ActiveDocument.Bookmarks("tmpMark").Delete
End Sub

  #4   Report Post  
Posted to microsoft.public.word.docmanagement
charles
 
Posts: n/a
Default How to save and return to position in document?

On Sun, 26 Feb 2006 11:16:27 -0500, charles
wrote:

Using Word 2000, I need to run a macro that selects parts of a
document, does some reformatting, and returns to the original
position.

I just can't think of how to save and return to the original position
in Word.

If anyone can help, I would appreciate it a lot.

Thanks.


Thank you Susan and Greg. Using bookmarks works fine. (I never used
them before and thought I'd have to do some VB thing like in Excel.)

Great.

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
document template - how to get autotext field update when saved Tom @ Kent State University Microsoft Word Help 5 February 8th 06 08:24 AM
Hebrew Suggestions Dannyza Microsoft Word Help 2 November 21st 05 06:12 AM
How can I unlock a document I saved in Word document? I cant edit. zookeeper Mailmerge 1 November 18th 05 04:45 AM
Return Address along Left Side of Envelope Jason Roberts Microsoft Word Help 3 May 26th 05 04:48 PM
Return Address Won't Save Ed New Users 5 January 16th 05 09:35 PM


All times are GMT +1. The time now is 06:56 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"