RichardP1978
Registered User.
- Local time
- Today, 23:09
- Joined
- Nov 14, 2006
- Messages
- 89
OK,
Tried doing a search, but all I found was what I can already do.
I use the following code to make access open word up, fill in a blank. What I would like to do is for access to open word, fill in the blank, print the word document out, and close word without confirming the need to save the file, the answer to this is no as the document does not need saving.
I have not used a report in access to do what I want, as there is fairly complex laying out required, (further down the line with another document) but being able to do this silently with this document would be good. Plus, when the layout has to change, I only edit a word document, not play around with a access report and then distribute it amongst all users.
So what I am asking, what other options can I put in code?
Thanks in advance.
Here is the code I use.
Set objWord = CreateObject("Word.Application")
objWord.Visible = True 'True is visible
objWord.Documents.Add ("F:\ClientDatabase\Templates\Tobaccorecordfor.dot")
objWord.activedocument.bookmarks("Name").Select
objWord.selection.Text = Forms![frmclientmain]![FirstName] & " " & Forms![frmclientmain]![Surname]
Tried doing a search, but all I found was what I can already do.
I use the following code to make access open word up, fill in a blank. What I would like to do is for access to open word, fill in the blank, print the word document out, and close word without confirming the need to save the file, the answer to this is no as the document does not need saving.
I have not used a report in access to do what I want, as there is fairly complex laying out required, (further down the line with another document) but being able to do this silently with this document would be good. Plus, when the layout has to change, I only edit a word document, not play around with a access report and then distribute it amongst all users.
So what I am asking, what other options can I put in code?
Thanks in advance.
Here is the code I use.
Set objWord = CreateObject("Word.Application")
objWord.Visible = True 'True is visible
objWord.Documents.Add ("F:\ClientDatabase\Templates\Tobaccorecordfor.dot")
objWord.activedocument.bookmarks("Name").Select
objWord.selection.Text = Forms![frmclientmain]![FirstName] & " " & Forms![frmclientmain]![Surname]