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 / October 2007

Tip: Looking for answers? Try searching our database.

cursor won't move to selection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
carlosremelios@yahoo.com - 17 Oct 2007 18:43 GMT
My code is below.  It works fine, moving from textframe to textframe
and asks the user about making changes to the text in the textframe
BUT the cursor and or screen doesn't move to the next location, it
just stays on page one.   Screen update, maybe?

Sub fixTextBoxes()

Dim s As Shape
For Each s In ActiveDocument.Shapes
   With s.TextFrame
       If .HasText Then s.Select
       Dim Msg, Style, Title, Help, Ctxt, Response, MyString
       Msg = "Do you want to Remove strikethrough and change font
color to black?"    ' Define message.
       Style = vbYesNoCancel + vbCritical + vbDefaultButton2    '
Define buttons.
       Title = "MsgBox Demonstration"    ' Define title.
       Help = "DEMO.HLP"    ' Define Help file.
       Ctxt = 1000    ' Define topic
       Response = MsgBox(Msg, Style, Title, Help, Ctxt)
       If Response = vbYes Then    ' User chose Yes
           Selection.Font.Color = wdColorBlack
           Selection.Font.StrikeThrough = False

       If Response = vbCancel Then Exit Sub
       Else    ' User chose No.
           MyString = "No"    ' Perform some action.
       End If
   End With
Next
End Sub
Jay Freedman - 17 Oct 2007 19:05 GMT
After the box is selected, try
  ActiveWindow.ScrollIntoView Selection.Range

I'm not sure how that will work with a textframe, but it's worth a try.

Something you didn't ask, but since you posted your code... If .HasText is
false, you probably want to skip the rest of the code down to the End With
statement.

Signature

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.

> My code is below.  It works fine, moving from textframe to textframe
> and asks the user about making changes to the text in the textframe
[quoted text clipped - 27 lines]
> Next
> End Sub
carlosremelios@gmail.com - 17 Oct 2007 21:04 GMT
> After the box is selected, try
>    ActiveWindow.ScrollIntoView Selection.Range
[quoted text clipped - 46 lines]
>
> - Show quoted text -

Voila!   Thank You!   It works perfectly.    Yes, I will clean up the
other funtioning, I didn't do that yet, because the basic functioning
wasn't working.  Thanks again.
 
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.