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 strongm 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 code

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
 
Ive sorted this problem now if anyone is curious leave a message n i'll give you the code.

Cheers


Sam
 
Hi Sam:

I read your poster and I saw that you found how to do something that I really need. In my case I have a database to pull exams, the questions are on word documents and I need to merge the diferent question on word document. I have a table where after run a code I have the number of the question, the mark and the path of the word document who contain te question. I need to use word to generate the report because some of the question have pictures, graphics and special characters. Any idea?

Thanks in advance

Trinitri
 
Exactly what I am trying to do. Your code would be MUCH appreciated.

Thanks
 
Well The code I have is only for text, it does not convert graphics at all not even lines. But as my report is simple it doesn't matter, If you need the lines and pictures etc then you could save it as a snapshot file (free image software by Microsoft), but then this is un editable. Ill paste both lines below. All this does is take the report and save it as a word document. If you have a specific template that you want to imput data into then there is code to do that somewhere on the forum.

If you want both text and pictures to be editabale, many people have generally recommended this site (I haven't used it yet so I don't know how it works),give it a try it might work!


The code to convert a report into a text only word document is....

DoCmd.OutputTo acReport, "Report Name", "RichTextFormat(*.rtf)", "C:\WINDOWS\FileNameYouWantToSaveAs.doc", True, ""

'the true is whether you want to view the picture after svaing

'To save as a Snapshot Viewer File...

DoCmd.OutputTo acReport, "ReportName",acFormatSNP, "C:\WINDOWS\FileNameYouWantToSaveAs.snp", False, ""

Hope this helps, If not let me know

Cheers

Sam
 
Finally I found the solution to my problem. Please If you need the code let me know.
Thanks
Trinitri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top