H
Helen
I need to send certain data from an open form in Access to Word. I need Word
to open a new document based on a custom template, and insert the proper
information at bookmarked fields. The user will then email the Word document
back and forth with other users for additional data. Using the following
code, the debugger stops me on line 2 and says the user defined function is
not recognized. I'm lost, I'm severely VBA challenged, and I have just two
days to get this running before I go out for surgery. Any help would be
appreciated. Alternatively, send alcohol...
Thanks!
Public Sub PrintToWord()
Dim wd As Word.Application
Dim myDoc As Word.Document
Set wd = New Word.Application
wd.Documents.Add “J:\Forms Designers\Conversions and updates\Forms HC-HD\2
Draft\HD AppointmentDB.dot†' The name and path
Set myDoc = wd.ActiveDocument
With wd.Selection
.GoTo wdGoToBookmark, Name:=â€Client†' The name of the bookmark
‘.Font.Bold = True ' You can choose if bold
‘.Font.Underline = False ' or underline
.TypeText Text:=me.ClientID ' insert values in field
End With
wd.Visible = True
to open a new document based on a custom template, and insert the proper
information at bookmarked fields. The user will then email the Word document
back and forth with other users for additional data. Using the following
code, the debugger stops me on line 2 and says the user defined function is
not recognized. I'm lost, I'm severely VBA challenged, and I have just two
days to get this running before I go out for surgery. Any help would be
appreciated. Alternatively, send alcohol...
Thanks!
Public Sub PrintToWord()
Dim wd As Word.Application
Dim myDoc As Word.Document
Set wd = New Word.Application
wd.Documents.Add “J:\Forms Designers\Conversions and updates\Forms HC-HD\2
Draft\HD AppointmentDB.dot†' The name and path
Set myDoc = wd.ActiveDocument
With wd.Selection
.GoTo wdGoToBookmark, Name:=â€Client†' The name of the bookmark
‘.Font.Bold = True ' You can choose if bold
‘.Font.Underline = False ' or underline
.TypeText Text:=me.ClientID ' insert values in field
End With
wd.Visible = True