View Single Post
  #1  
Old June 29th 07, 04:24 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 2
Default Problem create mail with Vista

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