Results 1 to 5 of 5

Thread: VBInstance question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2002
    Posts
    72

    VBInstance question

    Hi all,
    I am writing an add-in that manipulates selected text,
    My question is- how do I get the selected text ?
    I guess it should start with something like - "VBInstance.ActiveCodePane.CodeModule..."


    Thanks !

  2. #2
    Hyperactive Member sw_is_great's Avatar
    Join Date
    Nov 2003
    Posts
    330
    .selText
    Regards

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Selected text of what?

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    I am writing a VB Addin, but I havent actually used selected text yet.

    From what I have seen so far (this is just an educated guess), what you want is something like:

    VBInstance.ActiveCodePane.CodeModule.GetSelection(a,b,c,d)


    where a,b,c,d are numeric variables that will return the start/end positions of the selection (then use .Lines to get the relevant text)

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Dec 2002
    Posts
    72
    Thanks all,
    I finaly dicided to take the ugly way and use sendkeys to copy&paste and then taking the value from the clipboard...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width