Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
ThomasAJ ThomasAJ is offline
external usenet poster
 
Posts: 21
Default URGENT-SUDDENLY bookmarks lost when doing MailMerge to New Documen

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.

--
Regards
Tom
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
ThomasAJ ThomasAJ is offline
external usenet poster
 
Posts: 21
Default URGENT-SUDDENLY bookmarks lost when doing MailMerge to New Documen

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.

--
Regards
Tom


"ThomasAJ" wrote:

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.

--
Regards
Tom

  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
ThomasAJ ThomasAJ is offline
external usenet poster
 
Posts: 21
Default URGENT-SUDDENLY bookmarks lost when doing MailMerge to New Documen

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.
--
Regards
Tom


"ThomasAJ" wrote:

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.

--
Regards
Tom

  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default URGENT-SUDDENLY bookmarks lost when doing MailMerge to New Documen

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).Delet e

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(wdActiveEndSectionNum ber))

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).Delet e

bmrange.Characters(1).Delete

Loop

End With


--
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

"ThomasAJ" wrote in message
...
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.
--
Regards
Tom


"ThomasAJ" wrote:

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.

--
Regards
Tom



  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
ThomasAJ ThomasAJ is offline
external usenet poster
 
Posts: 21
Default URGENT-SUDDENLY bookmarks lost when doing MailMerge to New Doc

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!

--
Regards
Tom


"Doug Robbins - Word MVP" wrote:

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).Delet e

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(wdActiveEndSectionNum ber))

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).Delet e

bmrange.Characters(1).Delete

Loop

End With


--
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

"ThomasAJ" wrote in message
...
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.
--
Regards
Tom


"ThomasAJ" wrote:

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.

--
Regards
Tom






  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default URGENT-SUDDENLY bookmarks lost when doing MailMerge to New Doc



--
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

"ThomasAJ" wrote in message
...
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!

--
Regards
Tom


"Doug Robbins - Word MVP" wrote:

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).Delet e

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(wdActiveEndSectionNum ber))

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).Delet e

bmrange.Characters(1).Delete

Loop

End With


--
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

"ThomasAJ" wrote in message
...
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.
--
Regards
Tom


"ThomasAJ" wrote:

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.

--
Regards
Tom






  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default URGENT-SUDDENLY bookmarks lost when doing MailMerge to New Doc

From the Tools menu, select Options and then go to the Print tab and uncheck
the Update Fields item.

--
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

"ThomasAJ" wrote in message
...
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!

--
Regards
Tom


"Doug Robbins - Word MVP" wrote:

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).Delet e

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(wdActiveEndSectionNum ber))

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).Delet e

bmrange.Characters(1).Delete

Loop

End With


--
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

"ThomasAJ" wrote in message
...
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.
--
Regards
Tom


"ThomasAJ" wrote:

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.

--
Regards
Tom






  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
ThomasAJ ThomasAJ is offline
external usenet poster
 
Posts: 21
Default URGENT-SUDDENLY bookmarks lost when doing MailMerge to New Doc

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)

--
Regards
Tom


"Doug Robbins - Word MVP" wrote:

From the Tools menu, select Options and then go to the Print tab and uncheck
the Update Fields item.

--
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

"ThomasAJ" wrote in message
...
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!

--
Regards
Tom


"Doug Robbins - Word MVP" wrote:

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).Delet e

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(wdActiveEndSectionNum ber))

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).Delet e

bmrange.Characters(1).Delete

Loop

End With


--
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

"ThomasAJ" wrote in message
...
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.
--
Regards
Tom


"ThomasAJ" wrote:

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.

--
Regards
Tom






  #9   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default URGENT-SUDDENLY bookmarks lost when doing MailMerge to New Doc

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.

--
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

"ThomasAJ" wrote in message
...
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)

--
Regards
Tom


"Doug Robbins - Word MVP" wrote:

From the Tools menu, select Options and then go to the Print tab and
uncheck
the Update Fields item.

--
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

"ThomasAJ" wrote in message
...
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!

--
Regards
Tom


"Doug Robbins - Word MVP" wrote:

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).Delet e

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(wdActiveEndSectionNum ber))

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).Delet e

bmrange.Characters(1).Delete

Loop

End With


--
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

"ThomasAJ" wrote in message
...
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.
--
Regards
Tom


"ThomasAJ" wrote:

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.

--
Regards
Tom








  #10   Report Post  
Posted to microsoft.public.word.mailmerge.fields
ThomasAJ ThomasAJ is offline
external usenet poster
 
Posts: 21
Default URGENT-SUDDENLY bookmarks lost when doing MailMerge to New Doc

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



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
Cross Referencing Mailmerge Bookmarks Brian Mailmerge 3 May 12th 06 05:09 AM
Excel mailmerge data lost PhilT Mailmerge 1 December 5th 05 02:41 PM


All times are GMT +1. The time now is 08:33 AM.

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"