Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

"More than One Message or Notes Control" error in VBA when creating Outlook mail item.

Avatar of Bryce Bassett
Bryce BassettFlag for United States of America asked on
Microsoft OfficeOutlookMicrosoft ExcelVBA
6 Comments1 Solution626 ViewsLast Modified:
Automating Outlook from within Excel (2016) using VBA, I'm using fairly standard code to create a new mail object, set the To, Subject, Attachments, and Body, and display.
On Error Resume Next
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
    Set oOutlookApp = CreateObject("Outlook.Application")
End If

Set oItem = oOutlookApp.CreateItem(olMailItem)

With oItem
    .To = tostring
    .Subject = "Project Field Schedule: " & skeddeets.Cells(3, 2) & " " & skeddeets.Cells(3, 4)
    .Attachments.Add savedname
    .Body = "Attached please find the latest Field Schedule for the " & skeddeets.Cells(3, 2) & " " _
    & skeddeets.Cells(3, 4) & " project." & vbCrLf & vbCrLf & vbCrLf
    .Display  '.Send
End With
Sometimes it works fine, but about half the time I get this error message:
error
When I dismiss the error a looking at the new mail item, I can in fact see multiple redundant fields in the new email "form."  And I can't edit the body or send the email.  Where did these 'ghost' fields come from?  I've never seen these when I create a New Email from within Outlook.  How can I fix this error?  Thanks!
fields
ASKER CERTIFIED SOLUTION
Avatar of Kevin Casarez
Kevin CasarezSystems Administrator

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answers