I have a ReportViewer that generates a word document. The program then opens the word document for the user to view it. My issue is when I open it using code, the headers and footers do not display.
Header / Footer display fine
There is no visible headers / Footers here, but when I go to add one, the appear...
I use the following code to open my word document:
Private MSWord As New Word.Application
Private WordDoc As New Word.Document
Private Sub OpenWordFullScreen(ByVal ReportName As String)
Dim FolderPath As String = "C:\"
WordDoc = MSWord.Documents.Open(FolderPath & "\" & ReportName & ".doc")
MSWord.WindowState = Word.WdWindowState.wdWindowStateMaximize
MSWord.Visible = True
End Sub
How can I make the header and footers visible?
Adding the following code after setting my MSWord
to visible
MSWord.ActiveWindow.View.Type = Word.WdViewType.wdReadingView
Enabled me to view the header and footers as well as view the whole thing in FullScreen.