Hello all
In my window application, I have a button that can open a Word template
(letter). After add some details, I click "Save as" in this Word document.
I can insert a name for this file, then when I close this word file, I want
to print this file name (and its path).
Could you please tell me a method to do that. Below is what I did but it
does seem to work
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