Merge to Printer and to Email are fine.
Problem is only merge to new doc and then when I hit the print button it
loses the bookmarks.
The reason that the bookmarks are lost is because each bookmark in a
document must define a unique location in the document. If you execute the
merge to a new document, there would, in your case, be 7 locations, each
trying to use the one bookmark, which of course cannot be the case, so the
bookmarks do not appear in the document.
The following macro can be used as a work around
' 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).Delete
bmrange.Characters(1).Delete
Result.Bookmarks.Add System.PrivateProfileString("c:\bookmarks.txt",
"bookmarkNames", "bookmark" & k), bmrange
k = k + 1
Loop
End With
For i = 1 To Result.Hyperlinks.Count
linktarget = Result.Hyperlinks(i).SubAddress
Set linkrange = Result.Hyperlinks(i).Range
linkrange.Select
linktarget = linktarget &
Format(Selection.Information(wdActiveEndSectionNumber))
Result.Hyperlinks.Add Result.Hyperlinks(i).Range, "", linktarget
Next i
Source.Activate
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).Delete
bmrange.Characters(1).Delete
Loop
End With

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Merge to Printer and to Email are fine.
>
[quoted text clipped - 8 lines]
>>
>> I have re-installed (the repair option) Office 2003.
ThomasAJ - 23 Nov 2006 05:16 GMT
Hi Doug
I have been using these bookmarks for 18 months and all has worked just fine.
I repeat that this problem ONLY occurs when I merge to a new doc and ONLY
when I hit the PRINT key. So it views just fine but becomes !Undefined as
soon as I hit the print key.
It merges to email and direct to printer 100% fine.
Regarding the 7 docs, this problem also occurs if I select ONLY 1 record.
This problem occurred suddenly yesterday afternoon so I 'repaired' Office
but no luck.
Maybe I should totally re-install!

Signature
Regards
Tom
> The reason that the bookmarks are lost is because each bookmark in a
> document must define a unique location in the document. If you execute the
[quoted text clipped - 123 lines]
> >>
> >> I have re-installed (the repair option) Office 2003.
Doug Robbins - Word MVP - 23 Nov 2006 22:15 GMT

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Hi Doug
>
[quoted text clipped - 147 lines]
>> >>
>> >> I have re-installed (the repair option) Office 2003.
Doug Robbins - Word MVP - 23 Nov 2006 22:16 GMT
From the Tools menu, select Options and then go to the Print tab and uncheck
the Update Fields item.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Hi Doug
>
[quoted text clipped - 147 lines]
>> >>
>> >> I have re-installed (the repair option) Office 2003.
ThomasAJ - 23 Nov 2006 23:48 GMT
YES it did!
Of course I thank you very much.
Can you shed some light as to your reasoning please. This has been working
fine for some 18 months. Has an Office update casued this? There was an auto
update on Sunday but this started to fail 3 days after.
Also I don't know the down side to this change.
I use bookmarks extensively as results of calculations based on MergeFields.
(Yes I know it's best to use the database BEFORE feeding Word and I do but
sometimes it's easier in Word under certain circumstances)

Signature
Regards
Tom
> From the Tools menu, select Options and then go to the Print tab and uncheck
> the Update Fields item.
[quoted text clipped - 150 lines]
> >> >>
> >> >> I have re-installed (the repair option) Office 2003.
Doug Robbins - Word MVP - 24 Nov 2006 04:30 GMT
No, I don't know what would have changed. However, Updating of Fields
before printing is something that you would normally want to happen,
particularly for a document that contains a Table of Contents to ensure that
the page numbers in the table match those in the document. Also if you have
Page X of Y Pages to ensure that Y is the total number of pages in the
document.
On the other hand, the use of bookmarks is a mailmerge main document is to
be discouraged for the reason that I originally posted.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> YES it did!
> Of course I thank you very much.
[quoted text clipped - 175 lines]
>> >> >>
>> >> >> I have re-installed (the repair option) Office 2003.
ThomasAJ - 24 Nov 2006 06:09 GMT
Hi Doug
How do I contact you for Word consulting. Sorry but cannot find your contact
details anywhere.
I want to get this stuff I have done rock solid - it's important to my
company.
The consulting would not properly start until about Feb 2007 as here in OZ
the peak summer season is coming up for us and I am not doing any more
meaningful changes.
However there may be some minor stuff.
Tom
Doug Robbins - Word MVP - 24 Nov 2006 18:25 GMT
Here is my email address, well sort of, that should appear if you respond to
one of my posts
dkr@REMOVECAPSmvps.org

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Hi Doug
>
[quoted text clipped - 12 lines]
>
> Tom