![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |