Solved

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

Posted on 2004-09-30
4
288 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

739 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