Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Outlook OLE error code 0x00000001: Incorrect function
Message
From
11/01/2007 02:26:24
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01092329
Message ID:
01184451
Views:
23
>Hi Gary,
>
>More and more of my clients are getting this same error. We have found it >to be linked to the (automatic) security updates for Office 2003. When we >remove the update (downgrade from SP2 to SP1) everything works fine again.
>
>It looks from the error message, that the upgrade changes the interface to >one of the functions in Outlook. Does anyone know which one and how?

>Regards,
>Vidar


Hi Vidar,

I did not so much solve it as work around it!

I added an error trap and that worked and still displayed outlook (see below), but shortly after I persuaded the client to re-write the application into VFP9 and that does not have this problem for some reason!

Hope this helps

Regards

Gary.

New Code:
loOutlook=CREATEOBJECT("Outlook.Application")
loMessage=loOutlook.CreateItem(olMailItem)
loMessage.To=somone@anaddress.com
loMessage.Subject="test message"
loMessage.Body="My test"
loMessage.Attachments.Add(<PdfFile>)

lcError=ON("ERROR")              && NEW Line
ON ERROR lError=.T.              && NEW Line 

loResult=loMessage.Display()     && Amended line, stores return value

IF !EMPTY(lcError)               && NEW Line
  lcError="ON ERROR "+lcError    && NEW Line
  &lcError                       && NEW Line
ENDIF                            && NEW Line

loMessage=.NULL.
loOutlook=.NULL.
Previous
Reply
Map
View

Click here to load this message in the networking platform