userforms for bookmarks 
Author Message
 userforms for bookmarks

Hello,

(I am very new to VBA, so please excuse any egregious displays of
stupidity.)

I've searched through some of the postings for bookmarks, and the
consensus seems to be that bookmarks cannot be protected.  However, I've

been trying to think of 2 macros to Manage bookmarks.  Any ideas on the
following:

1.  A UserForm to ask the user, "Are you sure you want to delete
bookmark_name?"  If the user clicks "NO," the userform would run
something like the "Undo" tool.

2.  A UserForm to modify bookmarks.  The code to edit the contents of a
bookmark seems small and manageable, and I've started this one, but I'm
stuck on how to have UserForms respond to events.  I've been consulting
the on-line Microsoft Developer's Programming Guide, but the sections on

Event Code don't seem to contain many specific examples.  Does anyone
know where a lowly novice could find more info on UserForms and Event
Code?

Thanks,
Mark



Fri, 20 Sep 2002 03:00:00 GMT  
 userforms for bookmarks
Hi Mark,

Sometimes a fresh mind can bring new insights :-

Item #1 might be possible in Word 2000, it is definitely not possible in
Word 97. To do it in Word 2000, you would need to hook some code off the
WindowSelectionChange event (which is new to Word 2000). This code would
need to know how many bookmarks there were in the document before the event,
and how many afterwards, and then offer to undo the latest change if the
number of bookmarks is less. Dealing with Word's events is not the easiest
of tasks for a beginner, but if you want to have a go at it, be my guest! If
you get stuck, post back here with what you have so far, & we'll take a
look.

For #2, dealing with events in userforms is fairly straightforward. Before
you embark on a real task, I would recommend that you experiment with a few
things. just create a single userform, with perhaps just a single
CommandButton on it. Put some code into the CommandButton1_Click routine.
Run the form and click the button. Have a look at the other events for this
control and others, and just get used to it. There are plenty of code
examples in the help file to try out.

Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email

Quote:

>Hello,

>(I am very new to VBA, so please excuse any egregious displays of
>stupidity.)

>I've searched through some of the postings for bookmarks, and the
>consensus seems to be that bookmarks cannot be protected.  However, I've

>been trying to think of 2 macros to Manage bookmarks.  Any ideas on the
>following:

>1.  A UserForm to ask the user, "Are you sure you want to delete
>bookmark_name?"  If the user clicks "NO," the userform would run
>something like the "Undo" tool.

>2.  A UserForm to modify bookmarks.  The code to edit the contents of a
>bookmark seems small and manageable, and I've started this one, but I'm
>stuck on how to have UserForms respond to events.  I've been consulting
>the on-line Microsoft Developer's Programming Guide, but the sections on

>Event Code don't seem to contain many specific examples.  Does anyone
>know where a lowly novice could find more info on UserForms and Event
>Code?

>Thanks,
>Mark



Fri, 20 Sep 2002 03:00:00 GMT  
 userforms for bookmarks

Quote:
> Hi Mark,

> Sometimes a fresh mind can bring new insights :-

> Item #1 might be possible in Word 2000, it is definitely not possible in
> Word 97. To do it in Word 2000, you would need to hook some code off the
> WindowSelectionChange event (which is new to Word 2000). This code would
> need to know how many bookmarks there were in the document before the
event,
> and how many afterwards, and then offer to undo the latest change if the
> number of bookmarks is less. Dealing with Word's events is not the easiest
> of tasks for a beginner, but if you want to have a go at it, be my guest!
If
> you get stuck, post back here with what you have so far, & we'll take a
> look.

Just a little word of warning - WindowSelectionChange() fires *very* often,
so any code here really needs to act very, very quickly or users start to
grumble. Then they shout. Then they start throwing heavy objects.

Luckily, they missed ;-)

Scott
--
Scott Matthewman
Senior Developer
Direct Image Development & Consultancy Limited



Sat, 21 Sep 2002 03:00:00 GMT  
 userforms for bookmarks
Oh, I agree. The function I suggested should be able to run pretty quickly
if coded right though.

Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email

Quote:



>> Hi Mark,

>> Sometimes a fresh mind can bring new insights :-

>> Item #1 might be possible in Word 2000, it is definitely not possible in
>> Word 97. To do it in Word 2000, you would need to hook some code off the
>> WindowSelectionChange event (which is new to Word 2000). This code would
>> need to know how many bookmarks there were in the document before the
>event,
>> and how many afterwards, and then offer to undo the latest change if the
>> number of bookmarks is less. Dealing with Word's events is not the
easiest
>> of tasks for a beginner, but if you want to have a go at it, be my guest!
>If
>> you get stuck, post back here with what you have so far, & we'll take a
>> look.

>Just a little word of warning - WindowSelectionChange() fires *very* often,
>so any code here really needs to act very, very quickly or users start to
>grumble. Then they shout. Then they start throwing heavy objects.

>Luckily, they missed ;-)

>Scott
>--
>Scott Matthewman
>Senior Developer
>Direct Image Development & Consultancy Limited



Sat, 21 Sep 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. two questions on how to get data entries in userforms into bookmarks (if possible at all)

2. Word Bookmarks, Userforms and Updates

3. Bookmarks, References and Userforms

4. UserForms, Textboxes & Bookmarks

5. bookmarks & userforms

6. Bookmarks in userforms, how do you populate more then one place

7. Help with Bookmarks and userforms

8. Check Boxes, Userforms Bookmarks

9. no valid bookmark error message, without using bookmarks at all

10. Bookmark as Calculation of other bookmarks

11. Bookmark(2).value from other bookmark

12. replacing bookmark text in vba: bookmark deleted ?

 

 
Powered by phpBB® Forum Software