PDA

View Full Version : Removing & replacing Section Breaks from document



wilma
10-30-2007, 11:55 AM
I have one very large document containing Table rows with data in them. This is the result of a mail merge operation.
The macro that I have recorded to do this works very well.

However :
After every 3rd table row there is a section break, of the "Section Break Next Page" variety.

This means that I end up with seemingly a document consisting of an X-number of pages, but in reality with a 1-page document containing a lot of section breaks.
I need to replace each Section Break Next Page in this document by a Page Break, because the end-user needs to be able to make a choice of which pages to print when printing this document.
Performing a search & replace (all) doesn't work :
This sometimes only replaces the last section break in the document and sometimes it does not replace anything at all.
Can anyone help me, please ?

TonyJollans
10-31-2007, 02:30 AM
Each record in the Mail Merge ends up in its own Section - that's the way it works (unless you are doing a Catalog/Directory Merge).

The end user ought to be able to print sections as easily as pages (e.g s6 instead of p6 in the Print what box). Will that not be good enough?

wilma
11-01-2007, 05:21 AM
Each record in the Mail Merge ends up in its own Section - that's the way it works (unless you are doing a Catalog/Directory Merge).

The end user ought to be able to print sections as easily as pages (e.g s6 instead of p6 in the Print what box). Will that not be good enough?
Tony, thank you for your reply. However, this does not solve the problem.
Would it be OK if I send you the complete info, together with sample files ? -Wilma

TonyJollans
11-01-2007, 05:57 AM
Can you not post it here? If it's too big (or sensitive) to post you can send it to me (my forename at my surname dot com) but I'd much prefer it if you could post here so others can see it too.

Or at least a few more details about why it does not solve the problem - what does the user want to do?

wilma
11-01-2007, 07:20 AM
Tony,
Thank you again for your reply.
No sensitive info, Zipfile has the dot and the sample excel sheet.
Naturally everyone is welcome to share the info.
Just hadn't thought it through, sorry.

NOTE : The hard-coded path to the Excel file with the data is in the VBA code of the dot file..

The sequence is as follows :
User creates new document based on Acceptgiros.dot.
The new doc has a Macro Button to Press.
Pressing Macro-button "Press to fill with data" performs mailmerge and creates a new document consisting of custom labels(=addresses) (3 per section) named "Form Letters XX" .This doc is 1 single page with numerous sections.
The document "Form Letters XX" is then to be SAVED-AS with a new document name.

Now the problem arises:
The document consists of 1 single page, with numerous sections, 3 labels(=addresses) per section, in total about 600 addresses .
These addresses have to be printed to fixed spots onto pre-printed pages.
These are put in the printer paper feeder tray.
Paper tray holds only 15 pages.
Because of the numbers involved, the user can only print them in batches, of 15.
This can only be accomplished if the document is broken up into separate pages .
Printing by section is impossible, at least I haven't been able to figure out how to do this.

Manually deleting the section breaks works fine, for when you simply delete a "Section Break Next Page" the document is broken up into separate pages without having to do anything else.
This means that you would have to perform these actions manually , e.g.
Edit, Find, find ^b, close edit find, delete the break manually and start over again for the next section break. etc.etc....
I've not been able to find a method to do this automatically through a macro.
In short : how to delete the section breaks using a macro ? I hope you can help me ?
Thank you so much, Wilma

wilma
11-01-2007, 08:13 AM
Can you not post it here? If it's too big (or sensitive) to post you can send it to me (my forename at my surname dot com) but I'd much prefer it if you could post here so others can see it too.

Or at least a few more details about why it does not solve the problem - what does the user want to do?
Tony, I sent a reply, including a ZIPfile attachment.

TonyJollans
11-01-2007, 08:25 AM
Hi Wilma,

This wil be much simpler - giving you almost exactly what I think you want - if you have a Directory (or Catalog) merge. I have to go out for a couple of hours but will post back with a full solution later

TonyJollans
11-01-2007, 09:49 AM
You can tidy this up some more but all I have done is pre-fill your first merge label (and commented out the code that did it) and set the mailmerge type to directory merge. Is this any help?

wilma
11-02-2007, 04:26 AM
You can tidy this up some more but all I have done is pre-fill your first merge label (and commented out the code that did it) and set the mailmerge type to directory merge. Is this any help?
:) Tony,
Your code does the job perfectly.
As an added bonus, it also gets rid of all the excess lines that you get when recording a macro.
Thank you so very, very much.
Have a good weekend. Wilma

TonyJollans
11-02-2007, 05:05 AM
Graag gedaan :)