Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / November 2006

Tip: Looking for answers? Try searching our database.

URGENT-SUDDENLY bookmarks lost when doing MailMerge to New Documen

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ThomasAJ - 23 Nov 2006 01:41 GMT
No new updates, no changes recently, and all of a sudden bookmarks are not
there when mailmerged to a new document.

They are there in the source doc but NOT the new doc.

I have re-installed (the repair option) Office 2003.

Signature

Regards
Tom

ThomasAJ - 23 Nov 2006 02:50 GMT
New info. Created a new document with 1 bookmark. It conatins a Mergefield
from a DB. The bookmark is used thus: { =Bookmark }. I merge this doc to a
new doc. The new doc is created and initially shows the value of the merge
field. I press the PRINT icon, it prints my selected (say 7 pages), each one
has !Undefined Bookmark.

As I said previously I re-installed office 2003, it has SP2.

HELP please! This office cannot send any documents out.

Signature

Regards
Tom

> No new updates, no changes recently, and all of a sudden bookmarks are not
> there when mailmerged to a new document.
>
> They are there in the source doc but NOT the new doc.
>
> I have re-installed (the repair option) Office 2003.
ThomasAJ - 23 Nov 2006 03:21 GMT
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.
Signature

Regards
Tom

> No new updates, no changes recently, and all of a sudden bookmarks are not
> there when mailmerged to a new document.
>
> They are there in the source doc but NOT the new doc.
>
> I have re-installed (the repair option) Office 2003.
Doug Robbins - Word MVP - 23 Nov 2006 04:38 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.