Link to home
Start Free TrialLog in
Avatar of hallz
hallz

asked on

Run a VB macro on text selected in the outlook preview pane

Hi,

I want to write a vb macro that creates a new email from text i have selected in the preview pane (olPreview i think) however I am pretty new to outlook. How can I co about getting the selected text into a string so that i can then generate a new email from this text (I have generated emails before).

Any advice or pointers would be great.

Thanks,

hallz.
Avatar of hallz
hallz

ASKER

Note: I think it is actually called the 'Reading Pane' - the thing i need data from is the reading pane which sits under your list of emails in outlook.
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hallz

ASKER

The closest thing I have found is this

http://support.microsoft.com/?kbid=240935

There is probably some way to access the selection higher up somewhere in the api's, but this will be sufficient for my project.

Thanks for posting.
hallz,

The material in that link isn't even close to what you indicated you were looking for.  That code is for getting the currently selected item (e.g. message, contact, appointment, etc.) in a list of items.  It has nothing at all to do with returning text selected in the reading pane or the body of the message.  Did I misunderstand what you were looking for?
Avatar of hallz

ASKER

Hi BlueDevilFan,

I think you understood, I am simply writing a script to process a section of an email message, selected text would have been more convenient but as the message content is system generated I can find the information with some code and process from there.

Thanks for your Help,

hallz.