PRB: Set of DEFAULT Changed After MAPI.SESSION Logon (269170)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q269170 SYMPTOMS
Programmers often maintain a default directory in Microsoft Visual FoxPro applications. They use this directory for the creation of temporary tables, work files, and so forth. However, if a Microsoft Visual FoxPro application also makes use of MAPI functions to send or receive mail, the default directory may change without warning.
RESOLUTION
In order to maintain the default directory and still use MAPI functionality, store the current directory to a variable and switch back to it after you are finished with the MAPI process with the following code:
LOCAL loMAPISession, lcCurDir
lcCurDir = SYS(5) + SYS(2003)
*!* Create a MAPI Session object, logon then logoff
loMAPISession = CREATEOBJECT("MAPI.Session")
loMAPISession.Logon()
*!* Perform mail functions here.
loMAPISession.LogOff()
CD (lcCurDir)
RELEASE loMAPISession, lcCurDir
REFERENCESFor additional information, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
244343 PRB: Microsoft MAPI Control Changes the Current Working Director
299843 Using The Send Menu Changes The Current Directory
Modification Type: | Major | Last Reviewed: | 6/13/2002 |
---|
Keywords: | kbCodeSnippet kbCtrl kbDSupport kbprb KB269170 |
---|
|