Thread: [Solved] How to reset outlook style
View Single Post
 
Old 03-22-2016, 09:55 AM
PRA007's Avatar
PRA007 PRA007 is offline Windows 7 64bit Office 2010 32bit
Competent Performer
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default How to reset outlook style

I have in my clipboard that I want to paste to outlook editor and after that I want to format all the text to be normal style. How to do that.

Here is the code that I got from (I forget but it was from Greg Maxy)

Code:
Sub sendcomplexemail()

Dim olapp As Object
Dim olemail As Object
Dim olInsp As Object
Dim wddoc As Object

    On Error Resume Next
    Set olapp = GetObject(, "Outlook.Application")
    If Err <> 0 Then Set olapp = CreateObject("Outlook.Application")
    On Error GoTo 0
    Set olemail = olapp.CreateItem(0)
    With olemail
        .BodyFormat = 3
        .To = ""
        .Subject = "Movies Report"
        Set olInsp = .GetInspector
        Set wddoc = olInsp.WordEditor
        Set orng = wddoc.Range
        orng.Paste
        orng.Style = "normal"
        .Display
    End With
End Sub
I am not able to work with red part.
Reply With Quote