Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Excel 2003 Programming - Outlook.Application and Char(10)

Not sure about 2003 but have you tried using vbCR instead of chr(10) ?
Also vbLF or vbCRLF are possible.
--
Cheers
Nigel



"wmw" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
import Excel 2003 file into Outlook 2003 - NO NAMED RANGES?? lewisma9 Excel Discussion (Misc queries) 0 February 27th 07 12:23 AM
Copying Excel 2003 Selection into Outlook 2003 HTML E-Mail Message [email protected] Excel Discussion (Misc queries) 0 July 10th 06 03:07 PM
Display mail application either in Outlook, or Outlook express [email protected] Excel Programming 0 April 13th 04 09:50 PM
Programming a console application Bilal A F Excel Programming 1 November 19th 03 10:12 PM
programming outlook 2000 from excel david lindstrom Excel Programming 1 July 11th 03 08:38 PM


All times are GMT +1. The time now is 04:07 AM.

Powered by vBulletin® Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright 2004-2023 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"