Hi, a fairly simple procedure for creating an email has been working for me any my co workers for some time on our Win7, office 2010 machines. However one of my co workers has upgraded to Win8 and Office 2013, and the procedure doesn't pull in any of the ranges that are uses for the .To .Subject or .Body fields within the email. In Office 2010, the email gets displayed with all the relevant fields pulled from Sheet3 (my helper sheet), however in 2013, the email opens in display mode, but all the fields are blank. Any help as I've no experience of Win8 what so ever.
here's my code
here's my code
Code:
Sub SendAMail()
Dim oOApp As Object
Dim oMail As Object
Dim RngTo as Range
Dim RngSub as Range
Dim RngBdy as Range
Set oOApp = CreateObject("Outlook.Application")
Set oMail = oOApp.CreateItem(0)
Set RngTo = Sheet3.Range("F36")
Set RngSub = Sheet3.Range("D36")
Set RngBdy = Sheet3.Range("E36")
On Error Resume Next
' Change the mail address and subject in the macro before you run it.
With oMail
.To = Rngto
.CC = ""
.BCC = ""
.Subject = RngSub
.Body = RngBdy
.Display
End With
On Error GoTo 0
Set oMail = Nothing
Set oOApp = Nothing
End Sub