Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Turning an Access report into a Word Doc via VBA 3

Status
Not open for further replies.

SpankYou

Programmer
Feb 24, 2003
211
GB
Hey,

Any Idea how I would turn an Access report into a Word Doc via VBA coding? I know how to do it manually, but figured there must be some code available,

thanks in advance

Sam
 
try this...

Enter this code to generate your report.

Report1 refers to the name of your report, so input your report name wherever Report1 is used.

True makes the file open after the code is run. Enter False if you would like to set it to not open the file for viewing.

The code is below....

DoCmd.OutputTo acReport, "Report1", "RichTextFormat(*.rtf)", "C:\YourIntendedDirectory\Report1.doc", True, ""


Hope this helps...
 
but it STILL will not include thr 'graphics' (not even the simple lines, or shading of records /groups. There is CODE which purports to do so, SOMEWHERE within Tek-Tips.




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Thanks I'll take a gander for that I may well need it!

Sam
 
From my limited use/knowledge of Access I found that to retain graphics in a report the use of the Snapshot format to be perfectly simple (once found in Access 2K!). The report can not be modified and anyone wishing to view the report requires the snapshot viewer - free download from I used it as below so the user could determine where they wanted it stored.

stDocName contains the report name

DoCmd.Output acOutputReport, stDocName, acFormatSNP,,True

Jenny
 
Yeah.

I am having the same problem. I can get the report to go out normally in RTF in Word, but I am loosing the graphics. I need it to go into word with graphics.

Handy tip about the snapshot viewer. I use it when sending out purchase orders - works a charm.

Any ideas about getting it into word with graphics?

Thanks,



Steve Hewitt



Steve Hewitt
 


I haven't used it, and it is only 'tested' for Ms. A. ver '97, but there are a lot of positive references for this site.




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Thanks to everyone that helped me,

I used your idea of the snapshot jenny n it worked a treat.

Michael your idea was great but it turns out it didn't need editing after all.

Thanks once again for all the help

Cheers

Sam
 
Yeah, the tool works OK in Access 2002/2000 fine. Does the job, I'm playing now so it shows a nice user friendly report name for each report listed.

Anyone used it and tried what I am doing?

Good posts by the way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top