R
RzB
I have added a button to an application to open a
ReleaseNote for the user to view. This is the code I'm
using.. (error handling removed for clarity)
The file opens OK but I have some problems ....
------------------------------------------------------------
Private Sub butViewReleaseNote_Click() '++ CR# 2525
Dim objWordApp As Word.Application
Dim strApplicationPath As String
Dim strFilePathAndName As String
Set objWordApp = New Word.Application
strApplicationPath = GetApplicationPath
strFilePathAndName = strApplicationPath & "ReleaseNote.rtf"
If Dir(strApplicationPath & "ReleaseNote.rtf") <> "" Then
objWordApp.Documents.Open strFilePathAndName
objWordApp.ActiveDocument.ActiveWindow.ActivePane.View.Type = wdNormalView
objWordApp.ActiveDocument.ActiveWindow.ActivePane.View.Zoom.PageFit =
wdPageFitFullPage
objWordApp.Application.Visible = True
Else
MsgBox strFilePathAndName & " not found", vbOKOnly + vbInformation, "Not
Found "
End If
Set objWordApp = Nothing
End Sub
--------------------------------------------------------------
I have two problems....
1. It seems to completely ignore the
ActivePane.View.Type = wdNormalView and
ActivePane.View.Zoom.PageFit = wdPageFitFullPage
statements.
2. When closing the word document I get all kinds of hassle
about normal.dot being changed and do I want to save it...
I must be doing something fundamentally wrong.
Any thoughts..
Many thanks,
Roy
ReleaseNote for the user to view. This is the code I'm
using.. (error handling removed for clarity)
The file opens OK but I have some problems ....
------------------------------------------------------------
Private Sub butViewReleaseNote_Click() '++ CR# 2525
Dim objWordApp As Word.Application
Dim strApplicationPath As String
Dim strFilePathAndName As String
Set objWordApp = New Word.Application
strApplicationPath = GetApplicationPath
strFilePathAndName = strApplicationPath & "ReleaseNote.rtf"
If Dir(strApplicationPath & "ReleaseNote.rtf") <> "" Then
objWordApp.Documents.Open strFilePathAndName
objWordApp.ActiveDocument.ActiveWindow.ActivePane.View.Type = wdNormalView
objWordApp.ActiveDocument.ActiveWindow.ActivePane.View.Zoom.PageFit =
wdPageFitFullPage
objWordApp.Application.Visible = True
Else
MsgBox strFilePathAndName & " not found", vbOKOnly + vbInformation, "Not
Found "
End If
Set objWordApp = Nothing
End Sub
--------------------------------------------------------------
I have two problems....
1. It seems to completely ignore the
ActivePane.View.Type = wdNormalView and
ActivePane.View.Zoom.PageFit = wdPageFitFullPage
statements.
2. When closing the word document I get all kinds of hassle
about normal.dot being changed and do I want to save it...
I must be doing something fundamentally wrong.
Any thoughts..
Many thanks,
Roy