View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
wmw wmw is offline
external usenet poster
 
Posts: 1
Default Excel 2003 Programming - Outlook.Application and Char(10)

Excel 2003 is causing me an error with below code, I get a debug on the
Outlook.Application, Outlook.MailItem and Chr(10) coding. Even in the Help
Files Outlook.Application is indicated to be used and Chr(10) is discussed
which you would thing would be standard. All three work fine in Excel 97 to
2002, but if someone on the team has Excel 2003 and even sends the file back
to someone with 2002, the email will not generate.

Any assistance would be appreciated.


Sub Mail_workbook_Outlook(MgrsEmail As String, Name As String)

Dim outApp As Outlook.Application
Dim outMail As Outlook.MailItem
Set outApp = CreateObject("Outlook.Application")
Set outMail = outApp.CreateItem(olMailItem)
With outMail
.To = MgrsEmail
.CC = ""
.BCC = ""
.Subject = " Survey"
.Body = "An Audit was completed in your " & Name & " Location by the
Operations Team." & Chr(10) & Chr(10) & _
"One of the many goals of Operations Team is to provide a high
quality, valued service to our sales management team. Your comments will
enable us to determine how well we are achieving this goal and will be
helpful when providing services in the future." & Chr(10) & Chr(10) & _
"Your time and cooperation are appreciated." & Chr(10) & Chr(10) & _
"Thank you," & Chr(10) & Chr(10) & "Operations Team"
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
Set outMail = Nothing
Set outApp = Nothing
End Sub