Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Get selection into textstring (http://www.outlookbanter.com/outlook-vba/62577-get-selection-into-textstring.html)

Peter R.[_2_] December 5th 07 05:46 PM

Get selection into textstring
 
How do I get a marked piece of text in a email into a string in my VBA ?
Thanks Peter.

Sue Mosher [MVP-Outlook] December 5th 07 07:18 PM

Get selection into textstring
 
Marked where? Reading pane? Open Inspector window? In what version of Outlook?

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Peter R." wrote in message ...
How do I get a marked piece of text in a email into a string in my VBA ?
Thanks Peter.


Peter R.[_2_] December 5th 07 08:07 PM

Get selection into textstring
 
A piece of tekst marked in a opened email message.

"Sue Mosher [MVP-Outlook]" wrote:

Marked where? Reading pane? Open Inspector window? In what version of Outlook?

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Peter R." wrote in message ...
How do I get a marked piece of text in a email into a string in my VBA ?
Thanks Peter.



Sue Mosher [MVP-Outlook] December 5th 07 09:12 PM

Get selection into textstring
 
In what version of Outlook? In a received message? Message in the process of being composed?

What format message -- HTML, RTF, plain text?

All these details matter.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Peter R." wrote in message ...
A piece of tekst marked in a opened email message.

"Sue Mosher [MVP-Outlook]" wrote:

Marked where? Reading pane? Open Inspector window? In what version of Outlook?

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Peter R." wrote in message ...
How do I get a marked piece of text in a email into a string in my VBA ?
Thanks Peter.



Peter R.[_2_] December 5th 07 09:29 PM

Get selection into textstring
 
Thanks again Sue.

It´s Outlook 2007, it´s a received message in the Inbox.

"Sue Mosher [MVP-Outlook]" wrote:

In what version of Outlook? In a received message? Message in the process of being composed?

What format message -- HTML, RTF, plain text?

All these details matter.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Peter R." wrote in message ...
A piece of tekst marked in a opened email message.

"Sue Mosher [MVP-Outlook]" wrote:

Marked where? Reading pane? Open Inspector window? In what version of Outlook?

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Peter R." wrote in message ...
How do I get a marked piece of text in a email into a string in my VBA ?
Thanks Peter.



Sue Mosher [MVP-Outlook] December 5th 07 10:33 PM

Get selection into textstring
 
That's the easiest scenario to handle, because Word is always the email editor in Outlook 2007:

Set objOL = Outlook.Application
Set objDoc = objOL.ActiveInspector.WordEditor
Set objWord = objDoc.Application
Set objSel = objDoc.Windows(1).selection
MsgBox objSel.Text

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Peter R." wrote in message ...

It´s Outlook 2007, it´s a received message in the Inbox.

A piece of tekst marked in a opened email message.

How do I get a marked piece of text in a email into a string in my VBA ?



Peter R.[_2_] December 6th 07 04:38 AM

Get selection into textstring
 
thanks a lot!

"Sue Mosher [MVP-Outlook]" wrote:

That's the easiest scenario to handle, because Word is always the email editor in Outlook 2007:

Set objOL = Outlook.Application
Set objDoc = objOL.ActiveInspector.WordEditor
Set objWord = objDoc.Application
Set objSel = objDoc.Windows(1).selection
MsgBox objSel.Text

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Peter R." wrote in message ...

It´s Outlook 2007, it´s a received message in the Inbox.

A piece of tekst marked in a opened email message.

How do I get a marked piece of text in a email into a string in my VBA ?




Peter R.[_2_] December 6th 07 05:45 AM

Get selection into textstring
 
One more question, could this be any different in Outlook 2003 ? Thanks again!

"Sue Mosher [MVP-Outlook]" wrote:

That's the easiest scenario to handle, because Word is always the email editor in Outlook 2007:

Set objOL = Outlook.Application
Set objDoc = objOL.ActiveInspector.WordEditor
Set objWord = objDoc.Application
Set objSel = objDoc.Windows(1).selection
MsgBox objSel.Text

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Peter R." wrote in message ...

It´s Outlook 2007, it´s a received message in the Inbox.

A piece of tekst marked in a opened email message.

How do I get a marked piece of text in a email into a string in my VBA ?




Sue Mosher [MVP-Outlook] December 6th 07 04:50 PM

Get selection into textstring
 
Outlook 2003 would be completely different, since the only time when Word would be used is if the message is in RTF format and Word is the editor. In fact, to get the selection from a received plain text message, you'd need a third-party library (Redemption).

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Peter R." wrote in message ...
One more question, could this be any different in Outlook 2003 ? Thanks again!

"Sue Mosher [MVP-Outlook]" wrote:

That's the easiest scenario to handle, because Word is always the email editor in Outlook 2007:

Set objOL = Outlook.Application
Set objDoc = objOL.ActiveInspector.WordEditor
Set objWord = objDoc.Application
Set objSel = objDoc.Windows(1).selection
MsgBox objSel.Text

"Peter R." wrote in message ...

It´s Outlook 2007, it´s a received message in the Inbox.

A piece of tekst marked in a opened email message.

How do I get a marked piece of text in a email into a string in my VBA ?





All times are GMT +1. The time now is 07:55 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com