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.