PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Get selection into textstring

Reply

Get selection into textstring

 
Thread Tools Rate Thread
Old 05-12-2007, 05:46 PM   #1
Peter R.
Guest
 
Posts: n/a
Default Get selection into textstring


How do I get a marked piece of text in a email into a string in my VBA ?
Thanks Peter.
  Reply With Quote
Old 05-12-2007, 07:18 PM   #2
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: 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." <PeterR@discussions.microsoft.com> wrote in message news9132918-F812-4C3D-BE8E-01CB7E7B3F7C@microsoft.com...
> How do I get a marked piece of text in a email into a string in my VBA ?
> Thanks Peter.

  Reply With Quote
Old 05-12-2007, 08:07 PM   #3
Peter R.
Guest
 
Posts: n/a
Default Re: 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." <PeterR@discussions.microsoft.com> wrote in message news9132918-F812-4C3D-BE8E-01CB7E7B3F7C@microsoft.com...
> > How do I get a marked piece of text in a email into a string in my VBA ?
> > Thanks Peter.

>

  Reply With Quote
Old 05-12-2007, 09:12 PM   #4
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: 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." <PeterR@discussions.microsoft.com> wrote in message news:E13853CA-556D-4B5E-BF4C-2A8ED4FFD826@microsoft.com...
>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." <PeterR@discussions.microsoft.com> wrote in message news9132918-F812-4C3D-BE8E-01CB7E7B3F7C@microsoft.com...
>> > How do I get a marked piece of text in a email into a string in my VBA ?
>> > Thanks Peter.

>>

  Reply With Quote
Old 05-12-2007, 09:29 PM   #5
Peter R.
Guest
 
Posts: n/a
Default Re: 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." <PeterR@discussions.microsoft.com> wrote in message news:E13853CA-556D-4B5E-BF4C-2A8ED4FFD826@microsoft.com...
> >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." <PeterR@discussions.microsoft.com> wrote in message news9132918-F812-4C3D-BE8E-01CB7E7B3F7C@microsoft.com...
> >> > How do I get a marked piece of text in a email into a string in my VBA ?
> >> > Thanks Peter.
> >>

>

  Reply With Quote
Old 05-12-2007, 10:33 PM   #6
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: 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." <PeterR@discussions.microsoft.com> wrote in message news:C7E18112-3BD3-4AB5-97C8-4FE3BB40EF4B@microsoft.com...
>
> 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 ?


  Reply With Quote
Old 06-12-2007, 04:38 AM   #7
Peter R.
Guest
 
Posts: n/a
Default Re: 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." <PeterR@discussions.microsoft.com> wrote in message news:C7E18112-3BD3-4AB5-97C8-4FE3BB40EF4B@microsoft.com...
> >
> > 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 ?

>
>

  Reply With Quote
Old 06-12-2007, 05:45 AM   #8
Peter R.
Guest
 
Posts: n/a
Default Re: 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." <PeterR@discussions.microsoft.com> wrote in message news:C7E18112-3BD3-4AB5-97C8-4FE3BB40EF4B@microsoft.com...
> >
> > 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 ?

>
>

  Reply With Quote
Old 06-12-2007, 04:50 PM   #9
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: 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." <PeterR@discussions.microsoft.com> wrote in message news:8D7D88E8-58C7-44EF-ADC0-C23D7485BE71@microsoft.com...
> 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." <PeterR@discussions.microsoft.com> wrote in message news:C7E18112-3BD3-4AB5-97C8-4FE3BB40EF4B@microsoft.com...
>> >
>> > 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 ?

>>
>>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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