Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6.0 and Word

Status
Not open for further replies.

Paiva

Programmer
Joined
Sep 10, 1999
Messages
3
Location
BR
I have an VB6 routine that shows a word document. I'd like this document without commandbars and menu bar (File Edit...), but this configuration can not be saved (do not change default Word). How can I do that?<br>
<br>
Thanks,<br>
<br>
Paiva<br>

 
If you're controlling word with VB - I would have thought you could load the doc into word and hide the commandbars and menu bar *before* making that copy of word visible?<br>
<br>
Did I misunderstand you?<br>
<br>
Mike<br>
---<br>
Mike_Lacey@Cargill.Com<br>

 
Here goes the routine code:<br>
<br>
Public Sub AbreDocumentoWord(Documento As String)<br>
<br>
Dim A As New Word.Application<br>
<br>
A.Visible = True<br>
A.Documents.Open FileName:=Documento<br>
<br>
A.WindowState = wdWindowStateMaximize<br>
<br>
'Desabilita barras de ferramentas<br>
A.CommandBars("Standard").Visible = False<br>
A.CommandBars("Tables and Borders").Visible = False<br>
A.CommandBars("Formatting").Visible = False<br>
A.CommandBars("Database").Visible = False<br>
A.CommandBars("Drawing").Visible = False<br>
A.CommandBars("Visual Basic").Visible = False<br>
A.CommandBars("Stop Recording").Visible = False<br>
A.CommandBars("Microsoft").Visible = False<br>
A.CommandBars("AutoText").Visible = False<br>
A.CommandBars("Web").Visible = False<br>
A.CommandBars("WordArt").Visible = False<br>
A.CommandBars("3-D Settings").Visible = False<br>
A.CommandBars("Shadow Settings").Visible = False<br>
A.CommandBars("Picture").Visible = False<br>
A.CommandBars("Reviewing").Visible = False<br>
A.CommandBars("Control Toolbox").Visible = False<br>
A.CommandBars("Forms").Visible = False<br>
<br>
'Régua<br>
A.ActiveWindow.ActivePane.DisplayRulers = False<br>
<br>
'Janela Normal<br>
If A.ActiveWindow.View.SplitSpecial = wdPaneNone Then<br>
A.ActiveWindow.ActivePane.View.Type = wdNormalView<br>
Else<br>
A.ActiveWindow.View.Type = wdNormalView<br>
End If<br>
End Sub<br>
<br>
i don't known how to hide menu bar and not save this settings. help me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top