Referencing a bookmark in a table

K

Kamran

I have a bookmark to capture a manually entered date in a table cell. I want
to capture whatever anyone types into that cell and put it in the footer.
There are two problems:

1. If the person selects the entire cell and starts typing, the bookmark
gets deleted
2. If I select the whole cell to create the bookmark to prevent it from
getting deleted, the reference field takes the entire cell into the footer.

Is there a way to prevent the bookmark from getting deleted by overtyping?
Or, is there a switch I can put in the reference field to capture only the
text from the cell, without the cell?
Thanks!
 
G

G.G.Yagoda

When you use an AUTOTEXTLIST field within a bookmark, the bookmark will
not disappear no matter how often you change the contents of the field.

Insert > Fields > Links and References > AUTOTEXTLIST. Type in the
switches in the Description box exactly as shown above it. Assuming
that you want "Date" as the text in your AUTOTEXTLIST field, then
select the field and create a bookmark with the same name.

In the footer, reference the AUTOTEXTLIST field with a REF field naming
the "Date" bookmark.
 
K

Kamran

I appreciate the reply, but I'm not sure how to use this. The document is a
template for meeting minutes, and the preparer needs to type in the date. I
need to copy that date into the footer every time. I don't see how to use
AUTOTEXTLIST to give me the date I want in both places.
 
G

G.G.Yagoda

If you add this macro to the template, every time a new set of minutes
is created from the template it will automatically select the
AUTOTEXTLIST "Date" field, contained within a bookmark of the same
name, for the user to fill in:

Sub AutoNew()
ActiveDocument.Bookmarks("Date").Range.Select
End Sub

There's no need to copy the data into the footer; the field you've put
there already will do the job for you:

{ REF "Date" }

All that's left to do is update the REF field.
 
K

Kamran

I'm not sure this will work, though, because the person typing the minutes
may be entering a date from the past, and using using an AUTOTEXTLIST entry
automatically enters the system date. I want to capture whatever the person
types in that cell, without bringing the cell with it when I use the Ref
field.
Thanks.
 
G

Greg

Kamran,

You could try a Macrobutton bounded by the bookmark.

Type a space in the cell and insert the bookmark. Starting at the
first space, enter a Macrobutton field

{ MACROBUTTON NoMacro "Click here and enter date" } Toggle field
codes. Field code braces { } are entered with CTRL+F(
 
K

Kamran

That works, but the user can still very easily delete the bookmark by
selecting the cell and pressing Delete. Do you know of any way to reference
a bookmark and capture text only?
 
D

David

#1- Since you load a template, does the date location in the table stay
the same? If so, you could reference the cell coordinates. Then write
a Print and/or Close intercept routine to update the field in the
footer.

#2 - Could you insert a formfield separate from the table and only
protect that section? Then use 'Run Macro on exit' in the formfield
properties to update the footer.

#3 - Turn on View Bookmarks, and hire/train secretary not to delete
them? :) Sorry, couldn't resist.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top