S
Simon Verona
I want to create a Word document based on a template and display the
document ready for editting by the user.
Once the user has finished editting, they will save the document and close
word, I want to then pick up the document and copy it up to a server.
This is in vb.net. So far, I've managed to create the document and save it
away (so it knows the file location I wat it in) using the following code:
Dim LetterName As String = "c:\dms\forms\" & filename
Dim word As New Word.ApplicationClass
Dim doc As Word.Document
Debug.WriteLine("AppPath=" & System.Windows.Forms.Application.StartupPath)
Try
doc = word.Documents.Add(System.Windows.Forms.Application.StartupPath &
"\Dms Mailmerge.dot")
Catch ex As Exception
Debug.WriteLine("error = " & ex.InnerException.Message)
End Try
doc.SaveAs(LetterName)
word.Visible = True
word.Application.Activate()
I can't however, work out what to do next to pick up when Word is closed and
the file is saved? The vb.net application just carries on after the last
statement above.
Any thoughs ?
Regards
Simon
--
================================
Simon Verona
Dealer Management Service Ltd
Stewart House
Centurion Business Park
Julian Way
Sheffield
S9 1GD
Tel: 0870 080 2300
Fax: 0870 735 0011
document ready for editting by the user.
Once the user has finished editting, they will save the document and close
word, I want to then pick up the document and copy it up to a server.
This is in vb.net. So far, I've managed to create the document and save it
away (so it knows the file location I wat it in) using the following code:
Dim LetterName As String = "c:\dms\forms\" & filename
Dim word As New Word.ApplicationClass
Dim doc As Word.Document
Debug.WriteLine("AppPath=" & System.Windows.Forms.Application.StartupPath)
Try
doc = word.Documents.Add(System.Windows.Forms.Application.StartupPath &
"\Dms Mailmerge.dot")
Catch ex As Exception
Debug.WriteLine("error = " & ex.InnerException.Message)
End Try
doc.SaveAs(LetterName)
word.Visible = True
word.Application.Activate()
I can't however, work out what to do next to pick up when Word is closed and
the file is saved? The vb.net application just carries on after the last
statement above.
Any thoughs ?
Regards
Simon
--
================================
Simon Verona
Dealer Management Service Ltd
Stewart House
Centurion Business Park
Julian Way
Sheffield
S9 1GD
Tel: 0870 080 2300
Fax: 0870 735 0011