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

Tip: Looking for answers? Try searching our database.

VBA for Selecting One of 4 different paragraphs

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Laura C Johnson - 08 Sep 2006 21:09 GMT
Hello all!

I'm looking for some assistance. I'm using Word 2003, by the way.

I need to figure out how to give a user of my doc template the option of 4
different paragraphs (3 sentences max)...they select one of the paragraphs
and that paragraph is inserted in the template and the other 3 disappear.

Can someone help me?

Thanks in advance,
Laura
Jezebel - 09 Sep 2006 01:20 GMT
Before you start re-inventing the axle, have a look at what you can do with
AutoText. It's a different approach from your current thinking, but the
functionality is all there already.

Apart from that, you could add four bookmarks - one for each paragraphs,
then in your code check which bookmark contains the current selection and
delete the other three. But the total effort involved -- select within
exactly one of the paragraphs, call the macro; plus your task of providing
some way to call the macro, supporting the macro, and teaching the users to
use it, is -- it seems to me -- a lot more work than simply selecting the
paragraphs you don't want and pressing delete.

> Hello all!
>
[quoted text clipped - 8 lines]
> Thanks in advance,
> Laura
Robert M. Franz (RMF) - 10 Sep 2006 00:25 GMT
Hi Laura

> I need to figure out how to give a user of my doc template the option of 4
> different paragraphs (3 sentences max)...they select one of the paragraphs
> and that paragraph is inserted in the template and the other 3 disappear.

Yes, AutoText (4 entries in the same "category" aka style) and an
AutoTextList field might alredy be all you're looking for.

HTH
Robert
Signature

 /"\  ASCII Ribbon Campaign |   MS
 \ /                        |  MVP
  X        Against HTML     |  for
 / \     in e-mail & news   | Word

 
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.