Gary_Smith
New Member
- Joined
- Jul 26, 2017
- Messages
- 2
I have been using the below code for sending an Email from Excel for many years on Windows 7, having now moved to Windows 10 if i chose to display the email and there is an attachment i am unable to click the send button as it is masked by duplicated, but blank, To: CC: and Subject boxes.
With no attachment the issue do not happen and if i send instead of display it works fine but i need to display it for the user to be able to amend the To: address.
With no attachment the issue do not happen and if i send instead of display it works fine but i need to display it for the user to be able to amend the To: address.
Code:
Sub Test1()
Dim OutlookApp As Object
Dim OutlookMail As Object
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
On Error Resume Next
With OutlookMail
.To = "Mrs Miggings"
.CC = ""
.BCC = ""
.Subject = "Subject Text"
.Body = "Body Text"
.Attachments.Add Application.ActiveWorkbook.FullName
.display
End With
Set OutlookMail = Nothing
Set OutlookApp = Nothing
End Sub