A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Problem create mail with Vista



 
 
Thread Tools Search this Thread Display Modes
  #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.

  #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.

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

On 29 Giu, 16:33, "Sue Mosher [MVP-Outlook]"
wrote:
Where are you writing this code? Outlook VBA or somewhere else? What statement raises the error?


This code is written in VB6, the statement that raise the error is the
first: Set OutLk = CreateObject("Outlook.Application")

Sorry for the imprecision.

  #4  
Old June 29th 07, 08:50 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Problem create mail with Vista

If you get an error from code statements like these:

Dim ol as New Outlook.Application

Set ol = CreateObject("Outlook.Application")

the cause may be an anti-virus program on your computer that has a feature to block Outlook scripting. If so, the solution is to turn off the script blocking feature. You may need to contact technical support for your anti-virus program to find out how to do that.

I've also seen reports that setting the server parameter can resolve this problem in some situations:

Set ol = CreateObject("Outlook.Applicaton", localhost)

--
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...
On 29 Giu, 16:33, "Sue Mosher [MVP-Outlook]"
wrote:
Where are you writing this code? Outlook VBA or somewhere else? What statement raises the error?


This code is written in VB6, the statement that raise the error is the
first: Set OutLk = CreateObject("Outlook.Application")

Sorry for the imprecision.

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
POP Problem with Outlook 2003 & Vista stringshome Outlook - General Queries 2 March 6th 07 11:20 PM
Outlook 2007 on Windows Vista - can't programatically create a MAPI profile Stuart Bray Outlook and VBA 8 February 21st 07 10:37 PM
Vista/Outlook problem Jerome Phillips Outlook Express 2 February 9th 07 02:59 AM
Outlook 2007, Vista & RPC Problem Rob Gee Outlook - Installation 4 November 29th 06 06:06 AM
Outlook 2007 and Vista RC1 problem w AOL Alec J Wasserman Outlook - General Queries 1 September 16th 06 05:03 AM


All times are GMT +1. The time now is 08:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.