Add VBA save code

Steve Mc

New Member
Outlook version
Outlook 2007
Email Account
POP3
Diane provided me with this code to select an entire email message and save it all in a 12 point font.

It worked great. Thank you.

I would like add code at the end of this to save the email. What code instructions would do that ?

Thank you,

Steve

Public Sub FormatSelectedText()
Dim objItem As Object
Dim objInsp As Outlook.Inspector

' Add reference to Word library
' in VBA Editor, Tools, References
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim objSel As Word.Selection
On Error Resume Next

'Reference the current Outlook item
Set objItem = Application.ActiveInspector.currentItem
If Not objItem Is Nothing Then
If objItem.Class = olMail Then
Set objInsp = objItem.GetInspector
If objInsp.EditorType = olEditorWord Then
Set objDoc = objInsp.WordEditor
Set objWord = objDoc.Application
Set objSel = objWord.Selection
If objDoc.ProtectionType = WdProtectionType.wdAllowOnlyReading Then objDoc.UnProtect
' replace the With block with your code
With objSel
.WholeStory

' Formatting code goes here
'.Font.Color = wdColorBlue
.Font.Size = 12
'.Font.Bold = True
'.Font.Italic = True
'.Font.Name = "Arial"
End With
End If
End If
End If
objItem.Save

Set objItem = Nothing
Set objWord = Nothing
Set objSel = Nothing
Set objInsp = Nothing
End Sub
 
Similar threads
Thread starter Title Forum Replies Date
C Need VBA code to automatically save message outside outlook and add date Outlook VBA and Custom Forms 1
J Execute Add-In Button from VBA Outlook 2016 Outlook VBA and Custom Forms 1
S Example VBA Macro - To Conditionally Change the From Account and Add a BCC Address on Emails Outlook VBA and Custom Forms 11
JimG Use VBA to add <style> tag to Email. Outlook VBA and Custom Forms 2
N Get the seconds with userproperties.add method VBA Outlook Outlook VBA and Custom Forms 4
O VBA to change message format and add formatted signature Outlook VBA and Custom Forms 1
B Auto BCC VBA macro: how to add exceptions? Using Outlook 28
J Add categories to Shared Mailbox using VBA Using Outlook 2
R Limiting meeting attendees using VBA or an add-in Using Outlook 9
P Creating Add-in from VBA Outlook VBA and Custom Forms 1
J Add Multiple Attachments Sources using VBA in Word Outlook VBA and Custom Forms 6
H add an appointment for a custom calendar, vba excel Outlook VBA and Custom Forms 2
R vba rule exception "except with specific words in the sender's add Outlook VBA and Custom Forms 2
K Add Hyperlink in Email Body by VBA Outlook VBA and Custom Forms 1
B convert VBA code to Add-in Outlook VBA and Custom Forms 1
P Add inanimate objects to meetings? Using Outlook 1
O Outlook 2010 Add delete button to the side of the message list Using Outlook 1
BartH Add a string to the conditions in .Conditions.BodyOrSubject.Text Outlook VBA and Custom Forms 2
A "Get Add-Ins" - Which Version of Outlook to use Using Outlook 1
D Do I need Exchange Add-In? Using Outlook 6
C-S-R Manage Add-ins (Remove Wunderlist) Using Outlook 6
A iCloud add in problems Using Outlook 4
L Macro to add Date & Time etc to "drag to save" e-mails Outlook VBA and Custom Forms 8
C Looking for feedback on new Outlook Add-in Using Outlook 0
L isn't there an OL add-on that flags addressee before sending Using Outlook 3
P Shortcut Pane - add shortcut to Office365 group mailbox Using Outlook 1
B Add ComboBox Value to Body of Email Outlook VBA and Custom Forms 1
G How to add a folder shortcut to outlook quick access toolbar? Using Outlook 6
G Add to Outlook Contacts - Point to non-default contacts folder Using Outlook 0
M Automatically add senders first name to a greeting Outlook VBA and Custom Forms 1
C Add Form to Appointments Received, Automatically Outlook VBA and Custom Forms 6
O Outlook tasks - Add text column with multiple lines Using Outlook 3
W April 2020 Office 365 Update - Add-Ons fail after Office 365 Update Using Outlook 6
B Task Filter Not Working When I add too many criteria Using Outlook 0
D Add date next to day name in Outlook Today calendar view Using Outlook 1
D iCloud Add-in not working in Outlook 2013 and Outlook 2016 After Windows Upgrade & iCloud Upgrade Using Outlook 2
P Add Paste Unformatted to QAT Using Outlook 1
M Ignore slow add-ins Using Outlook 0
B Add Prefix text to Subject Line Using Outlook 1
Jennifer Murphy Add birthdays to calendar Using Outlook 7
Z Add text to auto-forwarded e-mail Outlook VBA and Custom Forms 4
P Add, remove, & reorder folder pane Using Outlook 6
L Tired of Outlook disabling Adobe PDF Creator add-in Using Outlook 1
R Add 'Company' to Select Names Form Using Outlook 1
A Outlook 2016 Web add-in missing on some machines Using Outlook 9
P Syncing problems with add-ins Using Outlook 3
Mark Foley Cannot enable add-in in outlook 2010 Using Outlook 0
BretAB Is it possible to add a lookup field to a Message form? Outlook VBA and Custom Forms 4
J Add an Attachment Using an Array and Match first 17 Letters to Matching Template .oft to Send eMail Outlook VBA and Custom Forms 2
iwshim outlook 2013 - I cannot see the "Manage Add-ins" Using Outlook 2

Similar threads

Top