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 / May 2006

Tip: Looking for answers? Try searching our database.

Undefined bookmark when form is protected

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 17 May 2006 17:36 GMT
I would appreciate your help. I have a final bill that has mail merge fields,
form dropdown fields and calculations. When I lock the form to access the
dropdown fields, I get a Undefined bookmark syntax error message. My final
bill initially asks you to enter two dollar amounts and assigns them to
estimate and ded. My balance due subtracts these two amounts. When I protect
the form to access the dropdown boxes, I receive the message "undefined
bookmark ! estimate". I am not sure how to change to form to continue the
subtraction after the form is locked.

I would greatly appreciate any help. Thank you in advance.
Doug Robbins - Word MVP - 17 May 2006 20:51 GMT
What is the purpose of  the mailmerge fields?  They are pretty much
incompatible with a protected document.

When you say the bill asks you to enter some amounts, exactly how is this
request being made.  In short, what sort for form is it?

See
Please Fill Out This Form
Part 1: Create professional looking forms in Word
http://www.computorcompanion.com/LPMArticle.asp?ID=22

Part 2: Adding Automation to your Word forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=46

Part 3: Learn more VBA (macros) to automate your forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=119

Part 4: Use custom dialog boxes in your Word forms
http://www.computorcompanion.com/LPMArticle.asp?ID=127

Part 5: Connect your AutoForm to a database to save input time and keep
better records!
http://www.computorcompanion.com/LPMArticle.asp?ID=136

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

>I would appreciate your help. I have a final bill that has mail merge
>fields,
[quoted text clipped - 8 lines]
>
> I would greatly appreciate any help. Thank you in advance.
John - 18 May 2006 20:30 GMT
Doug,

Thank you for your help. The bill uses a mail merge with an automobile
damage estimating system to get the vehicle owner's information, vin, vehicle
year, make mdodel, etc. It then asks you (using the "ask" and "REF"
statements to gain the repair total, deductibles, etc. to fill in the final
bill portion of the form. It then utilizes dropdown boxes to select the area
that the damage was located. The only time the form is protected is when you
need to access the dropdown boxes. I am trying to alter the way that the form
is designed but have to keep this form running until my re-designed form is
ready.

> What is the purpose of  the mailmerge fields?  They are pretty much
> incompatible with a protected document.
[quoted text clipped - 32 lines]
> >
> > I would greatly appreciate any help. Thank you in advance.
Doug Robbins - Word MVP - 19 May 2006 04:53 GMT
The execution of the mailmerge will destroy the bookmarks in the document as
NORMALLY, the merge results in multiple replicas of the document being
created which means multiple instance of a the bookmark, but as each
bookmark must have a unique name, the bookmarks are omitted from the
document created by executing the mailmerge.

You may be able to use the following, but I would suggest a complete
re-design of the system

' 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

> Doug,
>
[quoted text clipped - 53 lines]
>> >
>> > I would greatly appreciate any help. Thank you in advance.

Rate this thread:






 
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.