Quote:
Originally Posted by diwin
I already have in the code...
Optimization = True
Optimization = False
ActiveWindow.Refresh
|
Looks strange in this exact notation... :-) this is what I use:
Code:
Sub boostStart(Optional unDo$)
On Error Resume Next
If Len(unDo) Then ActiveDocument.BeginCommandGroup unDo
Optimization = True
EventsEnabled = False
ActiveDocument.SaveSettings
ActiveDocument.PreserveSelection = False
End Sub
Sub boostFinish(Optional ByVal endUndoGroup As Boolean = False, Optional ByVal doRedraw As Boolean = True)
On Error Resume Next
ActiveDocument.PreserveSelection = True
ActiveDocument.RestoreSettings
EventsEnabled = True
Optimization = False
If endUndoGroup Then ActiveDocument.EndCommandGroup
If doRedraw Then
CorelScript.RedrawScreen
ActiveWindow.Refresh
Application.Refresh
End If
End Sub
Usage:
boostStart "Action description"
........
.....action........
........
boostFinish True
just don't forget to pair boostStart and Finish in case of premature procedure exits