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 / Programming / February 2008

Tip: Looking for answers? Try searching our database.

Bookmarks

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Doc60 - 06 Feb 2008 13:36 GMT
I have created bookmarks in a table. However when a user enters new
information in the field the bookmark is erased.

I have tried using the following code:

Dim BMRange As Range
   Set BMRange = ActiveDocument.Bookmarks("value1").Range
   BMRange.Text = "0.1"
   ActiveDocument.Bookmarks.Add "Value1", BMRange

However, as you can see I have had to enter the BMRange.text as "0.1".  In
order for this to work. I don't want to have enter a value in the code.   I
want the user to beable to enter a value in the table so that the value can
also be changed.  Is here a way to do this. Please be specific with the code
that is necessary.

Thank you
Stefan Blom - 06 Feb 2008 13:51 GMT
See http://word.mvps.org/faqs/macrosvba/InsertingTextAtBookmark.htm.

Signature

Stefan Blom
Microsoft Word MVP

>I have created bookmarks in a table. However when a user enters new
> information in the field the bookmark is erased.
[quoted text clipped - 16 lines]
>
> Thank you
Doc60 - 06 Feb 2008 14:22 GMT
The code I wrote is the same. But this requires the value to be but in the
code and want to have the user put the value in the table without removing
the bookmark.

> See http://word.mvps.org/faqs/macrosvba/InsertingTextAtBookmark.htm.
>
[quoted text clipped - 18 lines]
> >
> > Thank you
Doc60 - 06 Feb 2008 14:30 GMT
I had already used the reference you mentioned. That is where the code from.
Please help further.

> The code I wrote is the same. But this requires the value to be but in the
> code and want to have the user put the value in the table without removing
[quoted text clipped - 22 lines]
> > >
> > > Thank you
Stefan Blom - 07 Feb 2008 09:31 GMT
Sorry, I misunderstood your original post. :-(

See David's reply instead.

Signature

Stefan Blom
Microsoft Word MVP

>I had already used the reference you mentioned. That is where the code
>from.
[quoted text clipped - 32 lines]
>> > >
>> > > Thank you
David Sisson - 06 Feb 2008 15:14 GMT
 
> I want the user to be able to enter a value in the table
> so that the value can also be changed.  

If your table in unprotected, then there is no way to prevent someone
from deleting bookmarks.

Here are a few othe ways to approach it.

You could add formfields in the table. Then the user can change the
field as required and you'd still have tha ability to change the
contents via code without losing the bookmark.

You could change the data via table coordinates.
ActiveDocument.Tables(1).Cell(2, 3).Range.Text = "My Text"

You could use a inputbox, and paste results via table coordinates.

You could create a userform to collect all relevant data and paste
using table coordinates.
Julian - 07 Feb 2008 23:16 GMT
One way you could do this would be to create additional rows or columns for
your table and set their height/width to zero - the user could not then
click in cells that contain the bookmark entries... (though they could of
course TAB into them :(.. but then you could use a selectionchange event to
check row/colum number and immediately move the selection out again, check
that the bookmark didn't get erased - but if it did, recreate it.

HTH
Signature

Julian I-Do-Stuff

Some Vista stuff, but mostly just Stuff at http://berossus,blogspot.com

>I have created bookmarks in a table. However when a user enters new
> information in the field the bookmark is erased.
[quoted text clipped - 16 lines]
>
> Thank you
 
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.