Article ID: 176060
Article Last Modified on 8/18/2005
119591 How to Obtain Microsoft Support Files from Online Services
*******************************************************************
SHOWFORM Sample
*******************************************************************
Purpose
-------
- Provide a DLL function that may be called from a Visual Basic
application that is using Active Messaging.
- Provide a sample of Extended MAPI code illustrating how to display
a message in its own form.
Files
-----
The Showform.exe contains the following files:
- Readme.txt - contains general information about this sample
- Showform.dll - release version of the sample DLL
- Showformd.dll - debug version of the sample DLL
- Main.cpp - source file for the DLL
- Main.h - header file for the DLL
- Showform.def - definition file for DLL Exports
- Showform.dsp - project file for the sample
- Showform.dsw - workspace file for the sample
Note that the project and workspace files were created in Microsoft
Visual C++ version 5.0.
How to Use
----------
The following is sample Visual Basic code that you can use to call the
ShowForm function in the sample DLL. Be sure to check "Microsoft Active
Messaging 1.1 Object Library" in the References dialog box from the Project
menu.
' Place this code in the General declarations of the main module
' of your project.
Public Declare Function ShowForm _
Lib "c:\mapitest\showform\debug\showform.dll" _
Alias "showform" (ByVal ProfileName As String, _
ByVal MsgID As String, _
ByVal FolderID As String, _
ByVal StoreID As String, _
ByVal hWnd As Long) _
As Integer
' Place this code in the Click event of a CommandButton on a
' form in your project.
Dim bRet As Integer
Dim oSession As Object
Dim oMsg As Object
' Create a MAPI Session.
Set oSession = CreateObject("MAPI.Session")
If oSession Is Nothing Then
MsgBox "Could not create Mapi Session", vbOKOnly, "VBSendRTF"
End
End If
' Logon to the Session.
oSession.Logon
' Locate the first message in the Inbox.
' NOTE: You could insert code here to locate the specific message
' that you want to view.
Set oMsg = oSession.Inbox.Messages.GetFirst
' You must call the Update method of the message object in order
' to obtain the actual Entry IDs associated with the message.
oMsg.Update
'Show the Message Form.
bRet = ShowForm(oSession.Name, oMsg.ID, oMsg.FolderID, _
oMsg.StoreID, hWnd)
If Not bRet = 0 Then
MsgBox "Show Form Failed with error: " & Hex$(bRet), _
vbOKOnly, "VBShowForm Warning"
End If
170601 HOWTO: Displaying the Compose IPM.Note Form
Additional query words: PrepareForm
Keywords: kbgraphxlinkcritical kbmsg kbfile kbcode KB176060