473,387 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Exporting a Report to a Word Document

I need to create word documents from an Access Report. Below is the code that I am using. It works but there are problems. The page breaks generated by the report don't always line up just right with where Word wants to break the page. So, sometimes I get one or two lines from the bottom of a page showing up at the top of a headerless page all by themselves. Then the Report page break comes and starts the next page with a header. So a 7-page report might have anywhere from 9 to 12 pages with the extra pages being mostly blank and headerless. I've tried fiddling with the top and bottom margins in the page layout, but it doesn't seem to help. Is there some way to avoid this dilemma?
Thanks.

Private Sub cmdCreateIt_Click()

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Dim stDocName As String
Dim Path As String
Path = DLookup("[Path]", "Region Data") & "\Region_" & DLookup("[Region]", "Region Data")
stDocName = "Selected Terms and Conditions"
DoCmd.OutputTo acReport, stDocName, _
acFormatRTF, Path & "\TCReports\" & Me![PermitNumber] & ".rtf", True

End Sub
Oct 17 '07 #1
3 4403
nico5038
3,080 Expert 2GB
The export to a Word document from a report is having many issues.
Personally I never use it.
When I need Access data in a word document I revert to using the Mailmerge option from MS Word and use a "report query" to get the data from.

Nic;o)
Oct 18 '07 #2
Thank you for the suggestion, however I'm not sure that it will work in this case. I use mailmerge for cases where various fields of data from the same record appear on the same page, but in this case it is selected records that appear sequentially on the page (or pages) with each records being sequentially numbered. So it looks like this:

{Header.......}

1. Legal mumbo jumbo from one of the selected records....
2. More legal mimbo jumbo from the next selected record....
3. Legal M.J.
4. Legal M.J.
.
.
.
37. Last bit of legal mumbo jumbo

See, what they do is check boxes in the library of the legal terms and conditions, then I have a query that selects only the records where the box is checked and those records appear in the detail section of the report. There is a counter in the detail definition to generate the numbers. Some of the individual terms and conditions can be several paragraphs long. Is this still possible using mail merge?

Thanks very much for any insight you might have.
P.S. Do you know if 2007 might improve the exporting problem at all?
Oct 22 '07 #3
nico5038
3,080 Expert 2GB
Hmm, then you'll need to use "automation" to manipulate the Word document from Access.
This link shows how to find a location in a Word document:
http://support.microsoft.com/kb/210032

For A2007 the "export" is made easier because of the use of SharePoint. This does however require a SharePoint Server or a subscription to a SharePoint service provider. (Will require $$'s)

Nic;o)
Oct 22 '07 #4

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

Similar topics

5
by: Jayjay | last post by:
Is it possible to export a report to word and have it include the graphics that are in the report? I'd like to take some of our reports and export them to word so we can email those to the...
0
by: Stephan Golux | last post by:
Hello. I am using an access 97 application that exports a report to RTF format, which is subsequently emailed to various people. The main informational field in the report is a free form memo...
0
by: Otis Hunter | last post by:
I have been fighting with this for days and your expert help is needed! Below is the code I am executing which results with "Object doesn't support this property or method". The error is occuring...
5
by: mik18 | last post by:
I'm having trouble with exporting reports to Word in the rtf format and I'm hoping someone has a solution. The reports are losing their formats. Not all the formating is lost but some is and of...
5
by: feck | last post by:
Hi, Is there any code/routine to export a report as a word document retaining the formatting. I have a requirment to produce some fairly detailed statisitical reports for transmission by e-mail....
1
by: gooberoot | last post by:
Hi, When exporting a report to Word - all the formatting is exported with no problems, with ONE exception. Check boxes that show up in the reports are missing. When exported to Word, I don't...
1
by: Mustufa Baig | last post by:
I have an ASP.NET website where I am showing off crystal reports to users by exporting them to pdf format. Following is the code: ---------------- 1 Private Sub ExportReport() 2 Dim oStream...
0
by: adamz5 | last post by:
I am currently exporting a crystal report using code. This works fine and exports the report to a word document onto disk using DiskFileDestinationOptions() and ExportOptions However when i...
2
by: Mux | last post by:
I am facing the following problem while exporting data to Word. The current implementation is as described below: I have a JSP file which has a link that enables you to export the data to Word....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.