Output to Word add pagebreak

V

Victor Torres

Hi to all... Long time since I post here but now I encounter a problem. I'm
creating a database that will export a report to MS Word. The export is
working right now. My problem is that when I export the file to Word it adds
a pagebreak at the end of every page. I need that when it exports the file
to Word, does it in a continuous way. Can it be done without formatting the
document in Word after the export??? I need to send this report to the
Government and it must be in a specific format. I manage to have it like
that but my only problem is the pagebreak. Thanks a lot for any help that you
can give me.
 
P

PieterLinden via AccessMonster.com

Victor said:
Hi to all... Long time since I post here but now I encounter a problem. I'm
creating a database that will export a report to MS Word. The export is
working right now. My problem is that when I export the file to Word it adds
a pagebreak at the end of every page. I need that when it exports the file
to Word, does it in a continuous way. Can it be done without formatting the
document in Word after the export??? I need to send this report to the
Government and it must be in a specific format. I manage to have it like
that but my only problem is the pagebreak. Thanks a lot for any help that you
can give me.


Only thing I can think of is to write a Word Macro that deletes all the
manual pagebreaks from the document after you finish creating it. Either
that or loop through all the documents in a folder and open the instance of
Word only once...
 
P

PieterLinden via AccessMonster.com

Victor said:
Hi to all... Long time since I post here but now I encounter a problem. I'm
creating a database that will export a report to MS Word. The export is
working right now. My problem is that when I export the file to Word it adds
a pagebreak at the end of every page. I need that when it exports the file
to Word, does it in a continuous way. Can it be done without formatting the
document in Word after the export??? I need to send this report to the
Government and it must be in a specific format. I manage to have it like
that but my only problem is the pagebreak. Thanks a lot for any help that you
can give me.


How about running the thing, then running a macro in Word or automating word
and doing something like this:

Sub RemoveManualPageBreaks()
'
' RemoveManualPageBreaks Macro
' Macro recorded 5/24/2010 by Pieter Linden
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^m" ' manual page break
.Replacement.Text = "" ' replace with nothing.
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top