Platform SDK: Exchange Server |
Administrators usually install new forms into the organization forms library if users throughout the organization need access. You can also install forms into this library programmatically, subject to the access rights under which your program is running.
To install a form into the organization forms library
When IMAPIFormMgr::OpenFormContainer detects HFRMREG_ENTERPRISE, it returns an interface pointer to the organization forms library. You can then call any of the MAPI-defined forms container methods.
The INSTFORM.EXE sample application is a command-line utility that installs or removes a Microsoft Exchange Server form. You can run it to study the installation of forms, and you can look at its source files (in particular INSTFORM.CPP), which are located in the \BKOFFICE\SAMPLES\EXCHANGE\INSTFORM directory. Some of the code from INSTFORM.CPP is reproduced here:
hr = MAPILogonEx( NULL, lpszProfile, lpszPassword, MAPI_LOGON_UI|MAPI_EXTENDED|MAPI_NEW_SESSION, &lpMAPISession); // Open form manager interface. hr = MAPIOpenFormMgr( lpMAPISession, &lpFormMgr); // Open appropriate form container. hr = lpFormMgr->OpenFormContainer( hFrmReg, lpFolder, &lpFormContainer); hr = lpFormContainer->InstallForm( NULL, ulUIFlags, UserParams.m_pszCfgFile);
For more information about MAPI form libraries, see the MAPI Programmer's Reference.