Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Michelle
 
Posts: n/a
Default Bookmarks disappear after merge

Is there any way to put bookmarks in a document that then gets merged? They
disappear after the merge.

I have several fields where the user needs to input data and those fields
are repeated over and over in the document.

I cannot use "fillin" and "ref" because the entire top of the screen
disappears after the merge (no toolbars or menus, just a grey area - I think
there must be something corrupted in the document but it cannot be retyped at
this point).
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default Bookmarks disappear after merge

I cannot use "fillin" and "ref" because the entire top of the screen
disappears after the merge (no toolbars or menus, just a grey area - I
think
there must be something corrupted in the document but it cannot be retyped
at
this point).


If these merges are being run by automating Word, I've read that you may
need to issue .Activate on the Window (and possibly set .Visible to True -
the ssequence may be significant).

Peter Jamieson
"Michelle" wrote in message
news
Is there any way to put bookmarks in a document that then gets merged?
They
disappear after the merge.

I have several fields where the user needs to input data and those fields
are repeated over and over in the document.

I cannot use "fillin" and "ref" because the entire top of the screen
disappears after the merge (no toolbars or menus, just a grey area - I
think
there must be something corrupted in the document but it cannot be retyped
at
this point).


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Bookmarks disappear after merge

I think that I may have responded to an earlier post suggesting that this
was not the way to go, but in one of my more masochistic moments I developed
the following for someone



' 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

"Michelle" wrote in message
news
Is there any way to put bookmarks in a document that then gets merged?
They
disappear after the merge.

I have several fields where the user needs to input data and those fields
are repeated over and over in the document.

I cannot use "fillin" and "ref" because the entire top of the screen
disappears after the merge (no toolbars or menus, just a grey area - I
think
there must be something corrupted in the document but it cannot be retyped
at
this point).


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
All menus and toolbars disappear after merge Michelle Mailmerge 3 March 30th 06 06:37 AM
Why do bookmarks in my Word Template disappear in the Word Doc? CWSS Paralegal Microsoft Word Help 1 December 20th 05 10:01 PM
How do I get blank pages to disappear from a mail merge? Kennco Mailmerge 2 December 12th 05 03:26 PM
access-word merge - tables and queries disappear uc user Mailmerge 2 April 22nd 05 01:45 PM
Can you create a multi-layered merge where certain merge fields a. mileszat Mailmerge 3 January 18th 05 03:46 AM


All times are GMT +1. The time now is 08:29 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"