hunsnowboard
03-22-2009, 10:10 AM
Hi there Everyone! My problem probably is very easy but I cannot find the solution! :(
I have a form with a command button. Once the command button is pressed I would like to happen the following:
1. close the active document (without saving)
2. open the "mydocument.doc" document which is in the same directory
So far this is the code but it does not work:
Private Sub next_Click()
Unload Me
ThisDocument.Close
Dim wordfile1 As String
wordfile1 = ThisDocument.Path & "\mydocument.doc"
Documents.Open wordfile1
End Sub
The problem is that I get a blank screen with ms word application open, but no document opened. :( Why is that happening? Please try to help if you can! Thank you in advance!
I have a form with a command button. Once the command button is pressed I would like to happen the following:
1. close the active document (without saving)
2. open the "mydocument.doc" document which is in the same directory
So far this is the code but it does not work:
Private Sub next_Click()
Unload Me
ThisDocument.Close
Dim wordfile1 As String
wordfile1 = ThisDocument.Path & "\mydocument.doc"
Documents.Open wordfile1
End Sub
The problem is that I get a blank screen with ms word application open, but no document opened. :( Why is that happening? Please try to help if you can! Thank you in advance!