• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA OUTLOOK [Selected PART of topic]

micszy

New Member
Hi all!

I need to take selection part of topic to userform.

Now i was working just with body of email and the below code works perfect.
Code:
  Set msg = Application.ActiveExplorer.Selection(1)
  Set WordEditor = msg.GetInspector.WordEditor
  Set Selection = WordEditor.Application.Selection
  If (Selection.Type = 1) Or (Selection.Type = 0) Or (Selection.Type = 2) Then
  SetText = Selection.Text
  MsgBox SetText
  End If
Is it possible to take to UF just a selected part of topic? When UF appear (code run) the selection from topic dissapear..

p.s I don't need whole topic - just a selection part
 
@ThrottleWorks

The fastest way to check it is to put it to module in outlook and that's all.

Select any part of received email and run this code. Everything works fine until you select a part of topic.

I think that's the difference between selected part of body and topic - part of topic is still being selected after run vba but topic selection dissapear after run macro.

I hope it's easier to understand what i mean
 
Is this..


Code:
Set msg = Application.ActiveExplorer.Selection(1)
  Set WordEditor = msg.GetInspector.WordEditor
  Set Selection = WordEditor.Application.Selection
  If (Selection.Type = 1) Or (Selection.Type = 0) Or (Selection.Type = 2) Then
    SetText = Selection.Text
        Load uf1
            uf1.TextBox1 = SetText
        uf1.Show 0
  End If
  End If
 
@Deepak

let's try to show by below pictures what i need to do.

On msgbox i need "Test1" and my code is able just to print on msgbox "Test2"


11.jpg


Select TEST1 in outlook and run code.
 
Back
Top