H
HS1
Hello all
In an Access form, I have a button that can open a Word template (letter).
Then I can click "Save as" in this Word document. I want to print this file
name (and its path). Following the suggestion from Alex in this forum:
I created a WithEvents in the module level:
--------
Public WithEvents objWdDoc As Word.Document
------
Then in a button events, I have
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim objWdApp As Object
objWdApp = CreateObject("Word.Application")
objWdApp.Visible = True
objWdDoc = objWdApp.Documents.Open(Filename:="c:\wordTemplate.doc")
-------------------------------------------
Then I have function to handle its Close event.
------
Private Sub objWdApp_Close()
Debug.Write("objWdDoc.FullName")
set objWdDoc = nothing
End Sub
However, the event seems not work
Could you please help
Many thanks
SH
In an Access form, I have a button that can open a Word template (letter).
Then I can click "Save as" in this Word document. I want to print this file
name (and its path). Following the suggestion from Alex in this forum:
I created a WithEvents in the module level:
--------
Public WithEvents objWdDoc As Word.Document
------
Then in a button events, I have
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim objWdApp As Object
objWdApp = CreateObject("Word.Application")
objWdApp.Visible = True
objWdDoc = objWdApp.Documents.Open(Filename:="c:\wordTemplate.doc")
-------------------------------------------
Then I have function to handle its Close event.
------
Private Sub objWdApp_Close()
Debug.Write("objWdDoc.FullName")
set objWdDoc = nothing
End Sub
However, the event seems not work
Could you please help
Many thanks
SH