bonekrusher
Registered User.
- Local time
- Yesterday, 19:09
- Joined
- Nov 19, 2005
- Messages
- 266
Hi, I copied this code from one of the threads but I am having trouble with one line. The line that loads the info from Access in to my word template:
The Info I want in access is in a table called "Table 2" and the Field is called test "Test" (table2.test)
Please help!!!
Private Sub Command4_Click()
'Declare the follwing
Dim objWord As Object
'Set word as an application and make it invisible
Set objWord = CreateObject("Word.Application")
objWord.Visible = False 'True is visible
'path and name of the template your are using.
objWord.Documents.Add ("C:\Temp\AccessTest1.dot")
'This is for the bookmark that you created in the template
objWord.ActiveDocument.Bookmarks("bmCusDetails").Select
'This is the field in access that containts the data that has to be entered at the
'bookmark
objWord.Selection.Text = ???????
'Word (or the document that you created with the template, will now open)
objWord.Visible = True
Set objWord = Nothing
End Sub
The Info I want in access is in a table called "Table 2" and the Field is called test "Test" (table2.test)
Please help!!!
Private Sub Command4_Click()
'Declare the follwing
Dim objWord As Object
'Set word as an application and make it invisible
Set objWord = CreateObject("Word.Application")
objWord.Visible = False 'True is visible
'path and name of the template your are using.
objWord.Documents.Add ("C:\Temp\AccessTest1.dot")
'This is for the bookmark that you created in the template
objWord.ActiveDocument.Bookmarks("bmCusDetails").Select
'This is the field in access that containts the data that has to be entered at the
'bookmark
objWord.Selection.Text = ???????
'Word (or the document that you created with the template, will now open)
objWord.Visible = True
Set objWord = Nothing
End Sub