I have a form that hold the information of Letters that has been sent. It assign a unique number and the current date to a form. The operator opens a word documents by pressing a button on this form. I want to show the Letter Number and the current date
in the top of the Word documents that opens. The operator save the Word document and attach it to the form after saving it. How I can send the field data of the form to word documents. The code of the Command button that opens the Word document is as follow:
Function FnWriteToWordDoc()
Dim objWord
Dim objDoc
Dim objSelection
Dim strFileName As String
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.add
strFileName = Me.txtIndicatorNumber
objWord.Visible = True
Set objSelection = objWord.Selection
objSelection.TypeText ("Please save the document before closing the word page")
objDoc.SaveAs "Z:\Virsa\temp\" & strFileName
End Function
Karim Vaziri Regards,