I am using word to preview some .docx documents from Access 2007.
My Current sub ...
I have tried to hide Word's ribbon with
and several other simular. How can I make the ribbon autohide or minimise?
My Current sub ...
Code:
'Word Document handling
[COLOR=green]'Previews word document(s) from named path[/color]
Public Sub PreviewWordDoc(WordDocFullPath As String, Optional Orientation As String = "Portrait")
Dim objWord As Word.Application
Set objWord = New Word.Application
With objWord
.Documents.Open filename:=WordDocFullPath, readOnly:=True
If Orientation = "Landscape" Then
.ActiveDocument.PageSetup.Orientation = wdOrientLandscape
.width = 450
.height = 450
Else
.ActiveDocument.PageSetup.Orientation = wdOrientPortrait
.width = 325
.height = 575
End If
.DisplayScrollBars = False
.ActiveDocument.ActiveWindow.View.zoom.Percentage = 50
[COLOR=green] '.ActiveDocument.ActiveWindow.Panes(1).Zooms(wdPrintView).PageFit = wdPageFitFullPage
'.CommandBars.item("Ribbon").Visible = False [/color]
.windowState = wdWindowStateNormal
.Visible = True
.Activate
End With
End Sub
Code:
.CommandBars.item("Ribbon").Visible = False