Hello,
I have been exporting date from a form to MS Word with no problem, using bookmarks in the word file and appropriate VBA:
On Error Resume Next
Dim objWord As Object
Dim strPath As String
strPath = DLookup("[TemplateLocation]", "TablePath", "[TemplateID]='" & Me.[TXTPATH] & "'")
Set objWord = CreateObject("Word.Application")
objWord.Visible = False
objWord.Documents.ADD strPath
objWord.ActiveDocument.Bookmarks("LNAME").Select
objWord.Selection.Text = Me.LNAME
strSavePath = DLookup("[TemplateLocation]", "TablePath", "[TemplateID]='WordSavePath'")
objWord.ActiveDocument.SaveAs strSavePath & Me![LName] & " " & Me.[FNAME] & "-" & Me.[TEMPLATEID] & " " & Right([FileNo], 4) & ".doc"
objWord.Quit
MsgBox "Form " & [TEMPLATEID] & " for " & [LNAME] & " " & [FNAME] & " - FILENO " & [FILENO] & " - has been saved in MAINFOLDER folder.", vbOKOnly, "Form Save"
I was wandering if this is also possible with PDF Files. I have a PDF file with fields I have created but do not know where to start.
Appreciate any help. Thank you
I have been exporting date from a form to MS Word with no problem, using bookmarks in the word file and appropriate VBA:
On Error Resume Next
Dim objWord As Object
Dim strPath As String
strPath = DLookup("[TemplateLocation]", "TablePath", "[TemplateID]='" & Me.[TXTPATH] & "'")
Set objWord = CreateObject("Word.Application")
objWord.Visible = False
objWord.Documents.ADD strPath
objWord.ActiveDocument.Bookmarks("LNAME").Select
objWord.Selection.Text = Me.LNAME
strSavePath = DLookup("[TemplateLocation]", "TablePath", "[TemplateID]='WordSavePath'")
objWord.ActiveDocument.SaveAs strSavePath & Me![LName] & " " & Me.[FNAME] & "-" & Me.[TEMPLATEID] & " " & Right([FileNo], 4) & ".doc"
objWord.Quit
MsgBox "Form " & [TEMPLATEID] & " for " & [LNAME] & " " & [FNAME] & " - FILENO " & [FILENO] & " - has been saved in MAINFOLDER folder.", vbOKOnly, "Form Save"
I was wandering if this is also possible with PDF Files. I have a PDF file with fields I have created but do not know where to start.
Appreciate any help. Thank you