Here is what I am trying to do:
From VB.net open a word template --- Done
Populate it from a database ------Done
Have word report back with the saved file name so as I can add it to the database history ----Not done.
I know is has something to do with the close events in word but I am unable to get it working.
I have made a class which I think should work:
Dim WithEvents wordApplication As New Microsoft.Office.Interop.Word.Application
this gives me a drop down for
Private Sub wordApplication_DocumentBeforePrint(ByVal Doc As Microsoft.Office.Interop.Word.Document, ByRef Cancel As Boolean) Handles wordApplication.DocumentBeforePrint
but I dont know how to invoke this routine.
Any help greatly appreciated.