KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q189599: HOWTO: Make Outlook Empty Mail from the Outbox w/OLE Automation

Article: Q189599
Product(s): Microsoft FoxPro
Version(s): WINDOWS:3.0,3.0b,5.0,5.0a
Operating System(s): 
Keyword(s): 
Last Modified: 30-JUL-1999

-------------------------------------------------------------------------------
The information in this article applies to:

- Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0, 5.0a 
-------------------------------------------------------------------------------

SUMMARY
=======

When you send an e-mail message to Outlook 97 or 98 using the MAPI OLE container
controls in Visual FoxPro for Windows, your e-mail messages might not leave the
Outbox.

MORE INFORMATION
================

One possible cause of this problem is that Outlook has the Internet Mail Only
(IMO) option installed, you are working offline, and you have not made a remote
connection.

If the e-mail message you sent is stuck in the Outbox, use the following code to
force Outlook to send the message:

     oOutlook = GETOBJECT(,"Outlook.Application")
     oNameSpace= oOutlook.GetNamespace("MAPI")
     oFolder = oNameSpace.GetDefaultfolder(4)     && Go to Outbox, folder 4
     oSend = oFolder.Items(1).Send                && Send waiting items

To test this code, create a new e-mail message addressed to yourself. Save and
close the message without sending it. Move this message to the Outbox and run
the preceding code. This should make Outlook send the message.

REFERENCES
==========

For additional information, please see the following articles in the Microsoft
Knowledge Base:

  Q185314 OL97: E-mail Does Not Leave the Outbox

  Q162343 OL97: How to Troubleshoot Mail Stuck in the Outbox

  Q185313 OL98: (IMO) E-mail Does Not Leave the Outbox

  Q182572 OL98: How to Troubleshoot Mail Stuck in the Outbox


(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Dean
Christopher, Microsoft Corporation.


Additional query words: kbAutomation kbVFp300b kbVFp300 kbVFp500 kbVFp500a kbMAPI

======================================================================
Keywords          :  
Technology        : kbVFPsearch kbAudDeveloper kbVFP300 kbVFP300b kbVFP500 kbVFP500a
Version           : WINDOWS:3.0,3.0b,5.0,5.0a
Issue type        : kbhowto

=============================================================================

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.