Southernwave
New Member
- Joined
- Jun 6, 2008
- Messages
- 8
Can I set the OUTLOOK themes from my Excel macro ?
I have the following macro that sends emails .. I would like to automatically set the background template in OUTLOOK
I have looked and read but can work out if I can or not .. or how
Thanks in advance
I have the following macro that sends emails .. I would like to automatically set the background template in OUTLOOK
Code:
Sub SendEMail()
Dim Email As String, Subj As String
Dim Msg As String, URL As String
Dim r As Integer, x As Double
Range("DataRow").Value = ActiveCell.Row
' Get the email address
Email = Cells(ActiveCell.Row, 17)
' Message subject
Subj = "Your Requested Piece of Music"
' Compose the message
Msg = ""
Msg = Msg & "Dear " & Cells(ActiveCell.Row, 11) & "," & vbCrLf & vbCrLf
Msg = Msg & "Thank you very much for your request ." & vbCrLf & vbCrLf & "I am pleased to inform you that your requested piece of music .... "
Msg = Msg & Cells(ActiveCell.Row, 3) & " by " & Cells(ActiveCell.Row, 2) & ".... will be broadcast on " & Cells(ActiveCell.Row, 9).Text & " ." & vbCrLf & vbCrLf & "I hope you enjoy it." & vbCrLf & vbCrLf
Msg = Msg & "MA" & vbCrLf
Msg = Msg & "US"
' Replace spaces with %20 (hex)
Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20")
Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")
' Replace carriage returns with %0D%0A (hex)
Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A")
' Create the URL
URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg
' Execute the URL (start the email client)
ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus
'
End Sub
I have looked and read but can work out if I can or not .. or how
Thanks in advance