Output to E-Mail does not work with Outlook open on Windows 8, 8.1 or 10

48 views
Skip to first unread message

Randy Friend

unread,
Aug 2, 2016, 12:18:55 PM8/2/16
to FRX2Any
We are having an issue with Windows 8 and above (works fine on Windows 7) where output to e-mail is not created unless Outlook is closed.

Looking in the Event Viewer, there is a error logged showing a 'Source' of 'DistributedCOM' with an 'Event ID of 10010, stating 'The server [GUID]  did not register with DCOM within the required timeout.'.

Tested systems are 64-bit with Outlook 2010.  If Outlook is closed, the e-mail with the report attached is created without any issue.

Anyone else have any DCOM issues like this and find a fix?

Thank you,
Randy

Randy Friend

unread,
Aug 3, 2016, 11:33:27 AM8/3/16
to FRX2Any
As a test, I created a basic Visual FoxPro 9 prg to send and e-mail with the below code and it works with Outlook open and closed on all OSes.

LOCAL loOutlook   AS Outlook.Application
LOCAL loNameSpace AS Outlook.NameSpace 
LOCAL loMailItem  AS Outlook.MailItem
LOCAL llShowItem  AS Boolean
 
#DEFINE olMailItem   0
 
loOutlook   = CREATEOBJECT('Outlook.Application')
loNameSpace = loOutlook.GetNamespace("MAPI")
loNameSpace.Logon
loMailItem  = loOutlook.CreateItem( olMailItem )   && This creates the MailItem Object
       xEmail           =  [yourEmailGoesHere]

WITH loMailItem
   .Subject = "VFP E-mail Automation using Standard method" 
   .Recipients.Add(xEmail) 
   .Body    = "This is the Main Text of the email" 
             .Send         && Calling this will cause a Security Dialog
ENDWITH


Randy Friend

unread,
Aug 4, 2016, 10:51:49 AM8/4/16
to FRX2Any
I do not have a fix as yet, but I found the issue.  Outlook is running under the local user account and the program sending the email is being 'Run as Administrator'.  The create object is failing due to different accounts being used.

A quick workaround is turn run Outlook as administrator as well, but I am looking for a better solution.
Reply all
Reply to author
Forward
0 new messages