By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,594 Members | 3,680 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,594 IT Pros & Developers. It's quick & easy.

Opening an Access report in Word

100+
P: 114
Wondering if somone knows how to open a Access report in Word or export it to Word. Currently I'm opening and printing a report using VBA with the following command (DoCmd.OpenReport "TheReportName", , , strWhere) and strWhere is a variable containg a list of key's for the report to print from a table.

Is this possable to do?

The reason for this is the person printing the report would like to do some editing of a memo field before printing, and saving the changes as a word.doc only if changes where made. Else just print and exit Word is all that would be required. The Access table with the record that contains the memo field is a history table, read only and no changes are allowed to this table.
Dec 27 '06 #1
Share this Question
Share on Google+
8 Replies


100+
P: 1,646
Wondering if somone knows how to open a Access report in Word or export it to Word. Currently I'm opening and printing a report using VBA with the following command (DoCmd.OpenReport "TheReportName", , , strWhere) and strWhere is a variable containg a list of key's for the report to print from a table.

Is this possable to do?

The reason for this is the person printing the report would like to do some editing of a memo field before printing, and saving the changes as a word.doc only if changes where made. Else just print and exit Word is all that would be required. The Access table with the record that contains the memo field is a history table, read only and no changes are allowed to this table.
Hi. I don't think you can export to word. You could use automation to recreate the report in Word. Could get messy though.
Dec 28 '06 #2

Expert 5K+
P: 8,434
Hi. I don't think you can export to word. You could use automation to recreate the report in Word. Could get messy though.
I notice there's an option in the Tools menu (Access 2000) to "Publish It with MS Word" - could this be any help? Is there a corresponding export function?
Dec 28 '06 #3

100+
P: 1,646
I notice there's an option in the Tools menu (Access 2000) to "Publish It with MS Word" - could this be any help? Is there a corresponding export function?
This will publish records in a word table, not transfer a report
Dec 28 '06 #4

Expert 5K+
P: 8,434
This will publish records in a word table, not transfer a report
Admittedly I've never used the "Office Links" before, but I just tried this one on a report, and it seems to have reproduced the same report in Word (same as what I saw in Preview, anyway), though it did lose the borders around things.

And there is no table in the word document - just formatted text.

I don't know exactly how well it worked, though, as this was a very simple tabular or columnar autoreport.

I'm still wondering, though, about the possibility of exporting as RTF.
Dec 28 '06 #5

100+
P: 1,646
Admittedly I've never used the "Office Links" before, but I just tried this one on a report, and it seems to have reproduced the same report in Word (same as what I saw in Preview, anyway), though it did lose the borders around things.

And there is no table in the word document - just formatted text.

I don't know exactly how well it worked, though, as this was a very simple tabular or columnar autoreport.

I'm still wondering, though, about the possibility of exporting as RTF.
You're right. It almost works out. This would satisfy the above question I'm sure.
Dec 28 '06 #6

100+
P: 114
Thanks to all of you that replied. I did give both ways a try and found that the links via tools>Office Links>MS Word fills the requirements in a round about way and it created a RTF document.

The problem is that the report is tied to the primary key "rec_no" for this table but in normal use the user clicks a "Print Selected" button that uses a selected "rec_no" and only printing desired report(s).

So in my case I get all 29230 records placed in an rtf document and then Word goes through a 7-10 minute conversion before opening in word.

What I would like to do is perform this process in VBA if that's possible so that the user only has to click either the "Print Selected" or "Send to Word" buttons.

The more I think about this the more I realize that this process could be used for several requirements that I have been asked for. Thanks again for the replies.
Dec 28 '06 #7

ADezii
Expert 5K+
P: 8,638
Admittedly I've never used the "Office Links" before, but I just tried this one on a report, and it seems to have reproduced the same report in Word (same as what I saw in Preview, anyway), though it did lose the borders around things.

And there is no table in the word document - just formatted text.

I don't know exactly how well it worked, though, as this was a very simple tabular or columnar autoreport.

I'm still wondering, though, about the possibility of exporting as RTF.
'The following code will Export rptEmployee to Employee.rtf and automatically
'load it in the Server Application, in this case Microsoft Word:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OutputTo acOutputReport, "rptEmployee", acFormatRTF, "Employee.rtf", True
Dec 28 '06 #8

100+
P: 114
'The following code will Export rptEmployee to Employee.rtf and automatically
'load it in the Server Application, in this case Microsoft Word:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OutputTo acOutputReport, "rptEmployee", acFormatRTF, "Employee.rtf", True
Did give it a try changing the rptEmployee to the report name that I want to send to Word. Definitely got the report in word for the complete table that the report uses.

I do have a command button that runs a VBA script that runs the report I desire to export/open with only selected records from that table printing. Here is the code:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "Memo141Report", , , strWhere
the strWhere is a string of PK's that the report uses to print from table.

Is there a way to do the same with the OutputTo command so that I only get what was desired instead of the complete table.
Dec 28 '06 #9

Post your reply

Sign in to post your reply or Sign up for a free account.