none
How can i save highlighted text RRS feed

  • Question

  • Hello, i've been trying  to figure out how i can save highlighted text that  i'm using  in as the "selection.range.text" in a vba macro and by being able to, in the macro,  capture that highlighted text, i can then just do a cntl/v back out in the word document for other uses.

    for example i might  highlight the word "RangeValue" and create a bookmark for "RangeValue" in a macro, but by having that macro also save that hightlighted "RangeValue" text automatically, i can then paste that text in other places without having to re-highlight "RangeValue" again.

    So i'm looking for a way to capture the text that i highlight automatically in a macro as a side action to another main even, ie creating a bookmark ect.

    Thanks for any pointers!

    BobK

    Friday, October 7, 2011 3:10 PM

Answers

  • Try just appending .Copy:

    selection.range.text.Copy

    It should be placed on the clipboard, available for the next Ctrl-V.


    HTH, Bernie
    Friday, October 7, 2011 4:50 PM

All replies

  • Try just appending .Copy:

    selection.range.text.Copy

    It should be placed on the clipboard, available for the next Ctrl-V.


    HTH, Bernie
    Friday, October 7, 2011 4:50 PM
  • Yes super great thanks again Bernie!!! appreciate your help, these small utils really make things go alot smoother!

    Have a great weekend Bernie!

    Friday, October 7, 2011 5:17 PM