I want to open a new or existing document minimized without any flash on screen, so I open it with Visibility set False.
If the WindowState is set Minimized (or Maximized) while it is not Visible and then set it Visible, the window is completely blank (without ribbon or document).
The window is fine if it matches the ActiveWindow's WindowState (if a Maximized window opens and sets a window to wxWindowStateNormal while not Visible it is also blank).
Why is this happening and how can I fix it? Word 2016
Quote:
Sub ProblemWindow()
ActiveWindow.WindowState = wxWindowStateNormal
Set myDoc = Documents.Add(Visible:=False)
'if myDoc's WindowState doesn't match ActiveWindow's the window is empty when set Visible
'myDoc.ActiveWindow.WindowState = wdWindowStateNormal
'myDoc.ActiveWindow.WindowState = wdWindowStateMaximize
myDoc.ActiveWindow.WindowState = wdWindowStateMinimize
myDoc.ActiveWindow.Visible = True
End Sub
|