Clif McIrvin
New Member
- Joined
- Dec 22, 2023
- Messages
- 11
- Office Version
- 365
- 2016
- Platform
- Windows
I just discovered that there is some discussion of Word vba here.
In Excel, I am used to being able to turn screen updating on and off, and programmatically trigging screen refresh at will.
Working with Word vba I have found what should be the appropriate commands; but I cannot make the screen refresh while my code is running.
For instance- this code snippet:
does not refresh the screen until my code has finished running.
I have also tried
What I am trying to do is to have the document window scroll to the correct position before the MsgBox displays.
Suggestions?
In Excel, I am used to being able to turn screen updating on and off, and programmatically trigging screen refresh at will.
Working with Word vba I have found what should be the appropriate commands; but I cannot make the screen refresh while my code is running.
For instance- this code snippet:
VBA Code:
Set r = Selection.Range 'begin search at user selected location
r.Expand wdSentence
Application.ScreenUpdating = False
ActiveWindow.ScrollIntoView r
Application.ScreenUpdating = True
DoEvents
varText = "Build Sub/Function headings?" & vbCrLf & _
"Is " & r.Text & vbCrLf & _
"where the search should begin?"
Select Case MsgBox(varText, vbYesNoCancel, "Mark Sub/Function Headings")
I have also tried
VBA Code:
Application.ScreenRefresh
Suggestions?