Solved

Export Access Report into Word (without losing the formatting!)

Posted on 2004-09-30
4
279 Views
Last Modified: 2008-02-01
I am trying to export an Access reoport (100+ pages).  I keep losing my formatting, and Word just decides to do all kinds of crazy things with my data, such as different spacing in different areas, and duplicating data.  The only reason that I even want to export to Word is to create a Table of Contents, and an index.  Is there any way to either fix the formatting issue in Word, or create a TOC and index on an Access report?  Thanks a bunch!!
0
Comment
Question by:pmle
4 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 12193132
Very few Access programmers export from Access reports to Word exactly for that reason.  Perhaps a better idea would be to export your Access reports as snapshot (*.snp) files, then in Word insert them as objects.

Hope this helps.
-Jim
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 12207501
Jim
Could you post the code for opening up a snapshot as an object in word. I've tried the following code that outputs a report selected from a listbox as a snapshot object, inserts it to a word document and attaches the document to an outlook email...and snpshot won't format at all.  The only thing that has come reasonably close to preserving the format has been when I export in rtf format.  My code using snapshot is excerpted below:

             'output value of bound column for selected list item to word
             DoCmd.OutputTo acOutputReport, ctlListBox.Column(0, varItem), acFormatSNP, "c:\Temp\" & ctlListBox.ItemData(varItem) & ".snp", False
             AppWord.Selection.InsertFile "c:\Temp\" & ctlListBox.ItemData(varItem) & ".snp", "", False, False, False
             If i < ctlListBox.ItemsSelected.Count Then
               AppWord.Selection.InsertBreak wdSectionBreakNextPage
             End If
         Next varItem
     
         'create email attachment
         Progress = "Generating Email"
         EventTitle = ctlListBox.ItemData(varItem)
         AppWord.ActiveDocument.SaveAs "c:\Temp\" & EventTitle & ".rtf", wdFormatDocument
         AppWord.ActiveDocument.BuiltInDocumentProperties("Title").Value = "Attached Word File - " & Date
         AppWord.ActiveDocument.Save
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Field behavior for "locked" form 12 29
Query to summarise data Like Pivot Table 3 29
Search Form with Run Time Error 3075 1 22
Query design issue 2 22
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now