Reply
 
Thread Tools Display Modes
  #1   Report Post  
Bevan
 
Posts: n/a
Default Page numbering on a mail merged document

I'm still in the process of working through that mail merged document which
seeks to create several hundred fully customised letters which include
generic parts but which also has specifically tailored parts of each letter
according to an access database which is being read. This is such as to
create letters which contain only relevant paragraphs to that client; a
customised letter.

I have however hit another problem in page numbering.
The actual page numbering seems to be working fine with the proper page
being shown on each page both before and after the merge, with each new
letter in the entire merged document starting again at 1.

Any help on trying to display the reference of the conditions on page xxx
would be fantastic. I want to have on the first page 'make sure that you read
the conditions on page 9' or whatever to appear. The length of each letter
changes and so it could be anywhere from page 8-17 which is why the coding is
needed.
Thanks.
The problem that I'm having is that I'm trying to refer to these pages on
the first page of each letter as follows:
"Please read the conditions on page xxx" which I had referring to a bookmark
on page 9 for example. The problem is that on a merge my bookmarks seem to
dissappear and so instead of page xxx, it will read "bookmark undefined". I
had been using the coding {PAGEREF Conditions} where i had a bookmark
'Conditions' on page xxx. This seems to work before the merge but after that
it doesn't.
  #2   Report Post  
Doug Robbins
 
Posts: n/a
Default

You will need to find a way of doing this that does not involve the use of
bookmarks. As the name of each bookmark in a document must be unique, any
bookmark in the mailmerge main document will not survive the merge process.

You may however be able to make use of the following macro to preserve
(=re-create) the bookmarks when a mailmerge is executed

' Throwaway Macro created by Doug Robbins to "preserve" bookmarks during a
MailMerge

'

Dim abm As Bookmark, bmrange As Range, i As Long, Result As Document, j As
Long, k As Long, linkrange As Range, linktarget As String

Dim Source As Document

Set Source = ActiveDocument

i = 1

For j = 1 To Source.MailMerge.DataSource.RecordCount

For Each abm In ActiveDocument.Range.Bookmarks

System.PrivateProfileString("c:\bookmarks.txt", "bookmarkNames",
"bookmark" & i) = abm.Name & Format(j)

i = i + 1

Next

Next j

For Each abm In ActiveDocument.Range.Bookmarks

abm.Range.InsertBefore "#"

abm.Range.InsertAfter "#"

Next

With ActiveDocument.MailMerge

.Destination = wdSendToNewDocument

.Execute

End With

Set Result = ActiveDocument

k = 1

Selection.HomeKey wdStory

Selection.Find.ClearFormatting

With Selection.Find

Do While .Execute(FindText:="#*#", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True

Set bmrange = Selection.Range

bmrange.Characters(bmrange.Characters.Count).Delet e

bmrange.Characters(1).Delete

Result.Bookmarks.Add System.PrivateProfileString("c:\bookmarks.txt",
"bookmarkNames", "bookmark" & k), bmrange

k = k + 1

Loop

End With


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"Bevan" wrote in message
...
I'm still in the process of working through that mail merged document
which
seeks to create several hundred fully customised letters which include
generic parts but which also has specifically tailored parts of each
letter
according to an access database which is being read. This is such as to
create letters which contain only relevant paragraphs to that client; a
customised letter.

I have however hit another problem in page numbering.
The actual page numbering seems to be working fine with the proper page
being shown on each page both before and after the merge, with each new
letter in the entire merged document starting again at 1.

Any help on trying to display the reference of the conditions on page xxx
would be fantastic. I want to have on the first page 'make sure that you
read
the conditions on page 9' or whatever to appear. The length of each letter
changes and so it could be anywhere from page 8-17 which is why the coding
is
needed.
Thanks.
The problem that I'm having is that I'm trying to refer to these pages on
the first page of each letter as follows:
"Please read the conditions on page xxx" which I had referring to a
bookmark
on page 9 for example. The problem is that on a merge my bookmarks seem to
dissappear and so instead of page xxx, it will read "bookmark undefined".
I
had been using the coding {PAGEREF Conditions} where i had a bookmark
'Conditions' on page xxx. This seems to work before the merge but after
that
it doesn't.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I email a mail merged document? Mark B Mailmerge 2 February 18th 05 07:37 PM
Printing Selected Pages from a Document Containing Multiple Page Numbering Schemes Don Page Layout 5 January 14th 05 04:07 AM
Printing Selected Pages from a Document Containing Multiple Page Numbering Schemes Don Formatting Long Documents 7 January 14th 05 04:07 AM
How do I change page numbering and locations in document sections. Geo Microsoft Word Help 1 January 8th 05 03:08 AM
FIrst page footers Noel S Pamfree Microsoft Word Help 7 December 6th 04 09:49 PM


All times are GMT +1. The time now is 01:27 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"