Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
christophercbrewster via OfficeKB.com christophercbrewster via OfficeKB.com is offline
external usenet poster
 
Posts: 68
Default "Go to" doesn't show new location of cursor

I have the "Go To" function in some small macros. (Control-G.) I'm having a
problem because it moves the cursor to the place I want but leaves the screen
displayed where it was before. It's inconsistent-- sometimes it works. Any
ideas?

--
Christopher Brewster
Lockheed Martin, Eagan MN

Message posted via http://www.officekb.com

  #2   Report Post  
Posted to microsoft.public.word.newusers
Klaus Linke Klaus Linke is offline
external usenet poster
 
Posts: 413
Default "Go to" doesn't show new location of cursor

"christophercbrewster via OfficeKB.com" u3143@uwe wrote:
I have the "Go To" function in some small macros. (Control-G.)
I'm having a problem because it moves the cursor to the place I
want but leaves the screen displayed where it was before.
It's inconsistent-- sometimes it works. Any ideas?



Hi Christopher,

What version of Word do you use, and what is the code of the macro?
It does sound like a bug...

As a work-around, you could insert
ActiveWindow.ScrollIntoView Selection.Range
at the end of your macros to scroll the Selection into view.

Regards,
Klaus
  #3   Report Post  
Posted to microsoft.public.word.newusers
christophercbrewster via OfficeKB.com christophercbrewster via OfficeKB.com is offline
external usenet poster
 
Posts: 68
Default "Go to" doesn't show new location of cursor

Klaus-- Word 2003, Windows XP. I have several routines that would leave the
user in a different place than where he started, which is annoying. So I
plant a bookmark, TempBkmk, and return to it. Below is one of the shortest of
these, which toggles showing and hiding the field codes. As I say, this works
at least half the time, but I don't see what makes it fail.

Sub ToggleShowFields()
ActiveDocument.Bookmarks.Add Range:=Selection.Range, Name:="TempBkmk"
ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes
Selection.GoTo What:=wdGoToBookmark, Name:="TempBkmk" ' Return to
original location
End Sub

--
Christopher Brewster
Lockheed Martin, Eagan MN

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...neral/200811/1

  #4   Report Post  
Posted to microsoft.public.word.newusers
Klaus Linke Klaus Linke is offline
external usenet poster
 
Posts: 413
Default "Go to" doesn't show new location of cursor

"christophercbrewster via OfficeKB.com" u3143@uwe schrieb im Newsbeitrag
news:8d15f5f6fe17b@uwe...
Klaus-- Word 2003, Windows XP. I have several routines that would leave
the
user in a different place than where he started, which is annoying. So I
plant a bookmark, TempBkmk, and return to it. Below is one of the shortest
of
these, which toggles showing and hiding the field codes. As I say, this
works
at least half the time, but I don't see what makes it fail.

Sub ToggleShowFields()
ActiveDocument.Bookmarks.Add Range:=Selection.Range, Name:="TempBkmk"
ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes
Selection.GoTo What:=wdGoToBookmark, Name:="TempBkmk" ' Return
to
original location
End Sub



Yes, that's annoying!! As far as I remember older versions, that behaviour
got worse in recent years.
It happens quite often now that after something I do -- like your toggling
"show field codes", or toggling between Outline and Layout and Normal view,
or other things -- I suddenly I don't see the text I was working on.
My usual (non-macro) way to deal with it is to use Shift+Right, Shift+Left
to bring the Selection into view again.

In your macro, you could use the work-around from my last post, and as long
as your macro doesn't mess with the Selection, you don't need the bookmark:

Sub TestGotoBM2()
ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes
ActiveWindow.ScrollIntoView Selection.Range
End Sub

Regards,
Klaus

  #5   Report Post  
Posted to microsoft.public.word.newusers
christophercbrewster via OfficeKB.com christophercbrewster via OfficeKB.com is offline
external usenet poster
 
Posts: 68
Default "Go to" doesn't show new location of cursor

Thanks for the suggestions... but I can't make the screen update correctly no
matter how many things I add. I also tried Application.ScreenRefresh, but no
luck. I actually have to manually scroll to find the cursor.

Klaus Linke wrote:
Klaus-- Word 2003, Windows XP. I have several routines that would leave
the

[quoted text clipped - 12 lines]
original location
End Sub


Yes, that's annoying!! As far as I remember older versions, that behaviour
got worse in recent years.
It happens quite often now that after something I do -- like your toggling
"show field codes", or toggling between Outline and Layout and Normal view,
or other things -- I suddenly I don't see the text I was working on.
My usual (non-macro) way to deal with it is to use Shift+Right, Shift+Left
to bring the Selection into view again.

In your macro, you could use the work-around from my last post, and as long
as your macro doesn't mess with the Selection, you don't need the bookmark:

Sub TestGotoBM2()
ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes
ActiveWindow.ScrollIntoView Selection.Range
End Sub

Regards,
Klaus


--
Christopher Brewster
Lockheed Martin, Eagan MN

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...neral/200811/1



  #6   Report Post  
Posted to microsoft.public.word.newusers
Klaus Linke Klaus Linke is offline
external usenet poster
 
Posts: 413
Default "Go to" doesn't show new location of cursor

"christophercbrewster via OfficeKB.com" u3143@uwe wrote:
Thanks for the suggestions... but I can't make the screen update correctly
no
matter how many things I add. I also tried Application.ScreenRefresh, but
no
luck. I actually have to manually scroll to find the cursor.


That's weird... So say Shift+RightArrow doesn't bring the Selection into
view either?

I haven't seen that yet.

Could be a driver issue (printer driver, graphics driver)?
You could also start Word in "safe mode" (holding down the Ctrl key while
you start it), to see whether it works then (which would implicate some
template or add-in).

Klaus

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
Figures numbers show up as "Figure 1.5" not "B.1" in Appendix Randy Microsoft Word Help 2 November 12th 08 03:42 PM
When I type "me" and hit the space bar, it show up as "me43333333 Dr Black Microsoft Word Help 1 November 2nd 08 06:13 AM
Location of "normal.dot" file in Word 2007 under Vista ULTIMATE? Jim In Minneapolis Microsoft Word Help 8 October 9th 08 10:37 PM
Location of "normal.dot" file in Word 2007 under Vista ULTIMATE? Jim In Minneapolis New Users 1 October 9th 08 06:53 AM
how do I set up a "expand/collapse" or "show/hide" field in Word WordDoc_FeatureUser Microsoft Word Help 2 May 12th 07 06:29 PM


All times are GMT +1. The time now is 08:11 PM.

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"