View Single Post
 
Old 10-07-2018, 02:53 PM
qtutorm qtutorm is offline Windows 7 64bit Office 2016
Novice
 
Join Date: Oct 2018
Posts: 2
qtutorm is on a distinguished road
Default Word window empty when opened minimized while Visible is False

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
Reply With Quote