Reply
 
Thread Tools Display Modes
  #1   Report Post  
sebFlyte
 
Posts: n/a
Default Using current selection in a word macro

I'm having an issue with word macros.

I'm trying to create a number of macros which involve doing certain things
to whatever is selected, for example:

Thanks some text, and put HTML tags round it so that "link text here" would
become "a href="" title=""code example here/a".

Anyone know if this is possible?
  #2   Report Post  
Shauna Kelly
 
Posts: n/a
Default

Hi Sebastian

VBA in Word always makes the Selection object available, and from that you
can work out what text, if any, the user has selected.

If you're new to VBA programming, you might like to see

Creating a macro with no programming experience using the recorder
http://www.word.mvps.org/FAQs/Macros...ngRecorder.htm
and
How to modify a recorded macro
http://www.word.mvps.org/FAQs/Macros...ordedMacro.htm

If you have follow up questions, you might like to use one of the VBA
newsgroups such as microsoft.public.word.vba.general.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word


"sebFlyte" wrote in message
...
I'm having an issue with word macros.

I'm trying to create a number of macros which involve doing certain things
to whatever is selected, for example:

Thanks some text, and put HTML tags round it so that "link text here"
would
become "a href="" title=""code example here/a".

Anyone know if this is possible?



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing a current page in MS Word Trudy Microsoft Word Help 3 July 25th 08 10:13 PM
Word2000 letterhead merge BAW Mailmerge 3 June 25th 05 01:17 PM
is word perfect compatible with office word? Noreen Microsoft Word Help 1 May 11th 05 11:17 PM
Macros - Keyboard Commands Janet Microsoft Word Help 6 April 11th 05 05:28 AM
Continuous breaks convert to next page breaks Jennifer Hunt Microsoft Word Help 2 December 30th 04 05:45 PM


All times are GMT +1. The time now is 11:44 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"