View Single Post
  #2  
Old June 29th 07, 04:33 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Problem create mail with Vista

Where are you writing this code? Outlook VBA or somewhere else? What statement raises the error?

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


wrote in message ups.com...
To automatically create a mail with an attachments I've always used
this code:

Dim allegati As Outlook.Attachment

Set OutLk = CreateObject("Outlook.Application")
Set email = OutLk.CreateItem(0)
With email
.Subject = "Subject"
.Body = "Body"
Set allegati = .Attachments.Add("c:\test.txt")
.Display
End With
Set email = Nothing
Set OutLk = Nothing

I use this code since 2-3 years ago, I have the references included in
the project and the only problem is that with Wista it doesn't work
and I get this error: "Object dosent support this property or method"
I use Outlook2003, if I try the same code with another PC with WinXP
or Win2000 everything works fine.

Thank you.

Ads