Hiding Macro Activity

  • Thread starter Thread starter WordWorker
  • Start date Start date
W

WordWorker

Is there a macro command -- and how is it phrased -- that will cause the
macro activity to be hidden and then another macro command to unhide it so
that all the user sees is the finished result of the macro?
 
Maybe you are thinking of the ScreenUpdating property and the ScreenRefresh
method?

From Word VBA Help:

*********************************
Word 2007 Developer Reference > Word Object Model Reference > Application
Object > Methods
Word Developer Reference
Application.ScreenRefresh Method

Updates the display on the monitor with the current information in the video
memory buffer.

Syntax

expression.ScreenRefresh

expression Required. A variable that represents an Application object.

Remarks
You can use this method after using the ScreenUpdating property to disable
screen updates. ScreenRefresh turns on screen updating for just one
instruction and then immediately turns it off. Subsequent instructions don't
update the screen until screen updating is turned on again with the
ScreenUpdating property.


Example
This example turns off screen updating, opens Test.doc, inserts text,
refreshes the screen, and then closes the document (with changes saved).

Visual Basic for Applications
Dim rngTemp As Range

ScreenUpdating = False
Documents.Open FileName:="C:\DOCS\TEST.DOC"

Set rngTemp = ActiveDocument.Range(Start:=0, End:=0)

rngTemp.InsertBefore "new"
Application.ScreenRefresh
ActiveDocument.Close SaveChanges:=wdSaveChanges
ScreenUpdating = True
*********************************
 
Back
Top