Show MS-WORD menu and toolbar.

I am runing an application that create a ms-word document, but when the word is opened the window does not shows the menu and the toolbar. My code is following:

Dim xapp As Word.Application
Dim xdoc As Word.Document
Dim xsel As Word.Selection
 
Set xapp = New Word.Application
Set xdoc = xapp.Documents.Add
Set xsel = xapp.Selection

'... open file

xapp.WindowState = wdWindowStateMaximize
xapp.PrintPreview = True

Set xsel = Nothing
Set xdoc = Nothing
Set xapp = Nothing


Thanks!
ogirAsked:
Who is Participating?
 
adityauConnect With a Mentor Commented:
Before the statement
xapp.WindowState = wdWindowStateMaximize

call the following statement
xapp.Visible = True
0
 
ogirAuthor Commented:
My window application is  appearing on the screen. The program has "xapp.visible = true" but is the toolBar and Menu "File Edit ...." that is not appear in the window.
0
 
adityauCommented:
I tried it. With xapp.Visible=True, Menu and tool bar appears. Without that, it shows word without menu bar.
0
 
ogirAuthor Commented:
It´s runnig correctly now.
Thanks!
0
 
ogirAuthor Commented:
It´s runnig correctly now.
Thanks!
0
All Courses

From novice to tech pro — start learning today.