Article ID: 926453 - Last Review: October 30, 2006 - Revision: 1.2 Description of the mail envelope API in 2007 Office applicationsOn This PageINTRODUCTIONSeveral 2007 Microsoft Office applications provide an API that lets a mail client interface with 2007 Office applications when the API is implemented by the mail client. This API provides an integrated experience for sending a copy of a 2007 Office document. If the default mail client implements the API, you can use the Microsoft Office Outlook 2007 mail envelope experience directly in 2007 Office applications. MORE INFORMATIONFor you to use the mail envelope experience directly in 2007 Office applications, the mail client must implement the following interfaces. IMsoEnvelopeUse the IMsoEnvelope interface to host a mail envelope in an application.Collapse this table
Vtable orderCollapse this table
IMsoEnvelope ::InitThe Init method initializes the envelope and gives the envelope a pointer to its host interface.SyntaxParameterspunk[in] IUnknown interface pointer that points to message data that is either an IStream interface or an IDispatch interface. penvsite [in] Pointer to the EnvelopeSite interface that hosts the envelope. Note This object must also support the IServiceProvider interface and be able to provide the IMsoComponentManager object from a call to the QueryService method. grfInit [in] The following flags can be set:
Return valuesThis method returns the following values:
IMsoEnvelope ::SetParentThe SetParent method gives the envelope the window handle (HWND) of the parent window.SyntaxParametershwndParent[in] HWND of the parent window. Return valuesS_OKThe call succeeded and returned the expected value or values. IMsoEnvelope ::ResizeThe Resize method tells the envelope to resize to the passed-in size.SyntaxParametersprc[in] Rectangle in which to resize. Return valuesS_OKThe call succeeded and returned the expected value or values. IMsoEnvelope ::ShowThe Show method tells the envelope to show itself or to hide itself.SyntaxParametersfShow[in] Indicates whether to show the envelope or to hide the envelope. Return valuesS_OKThe call succeeded and returned the expected value or values. IMsoEnvelope ::SaveThe Save method tells the envelope to save its data in the passed-in stream.SyntaxParameterspstm[in] Stream in which to put the data. grfSave [in] Flag that affects the save. This flag is not used. Return valuesThis method returns the following values:
IMsoEnvelope ::GetAttachThe GetAttach method is a no-operation (no-op) method and always returns S_OK.SyntaxIMsoEnvelope ::SetAttachThe SetAttach method adds an attachment to the envelope.SyntaxParameterswszName[in] Name of the attachment. wszCID [in] Content ID of the attachment. ppstm [out][in] Stream in which to put the attachment. pgrfAttach [out][in] Flags that describe the attachment. These flags are not used. Return valuesThis method returns the following values:
IMsoEnvelope ::SetHelpModeThe SetHelpMode method is a no-operation (no-op) method and always returns S_OK.SyntaxIMsoEnvelope ::NewAttachThe NewAttach method is a no-operation (no-op) method and always returns S_OK.SyntaxIMsoEnvelope ::SetFocusThe SetFocus method tells the envelope to set the focus in the envelope.SyntaxParametersgrfFocus[in] Flag that indicates how to set the focus. The following flags can be set:
Return valuesS_OKThe call succeeded and returned the expected value or values. IMsoEnvelope ::GetHeaderInfoThe GetHeaderInfo method returns the header information from the envelope.SyntaxParametersdispid[in] Header property to retrieve. grfHeader [in] Flags. These flags are not used. ppv [out] Returned information. This value is property specific. The following property is supported: dispidSubject 0x0037 Returns the subject of the note. The ppv parameter returns a pointer to a wide string that contains the subject. The memory is allocated with the OLE task memory allocator. Return valuesThis method returns the following values:
IMsoEnvelope ::SetHeaderInfoThe SetHeaderInfo method sets information for the envelope header.SyntaxParametersdispid[in] Header property to set. pv [in] Data to be set. The type of this parameter is property specific. The following properties are used:
Return valuesS_OKThe call succeeded and returned the expected value or values. IMsoEnvelope ::IsDirtyThe IsDirty method returns a value that indicates whether the envelope is dirty.SyntaxReturn valuesThis method returns the following values:
IMsoEnvelope ::GetLastErrorThe GetLastError method returns the error string for the passed-in error code.SyntaxParametershr[in] HRESULT value for which to obtain the display string. wszBuf [out][in] Buffer in which to put the string. cchBuf [in] Count of wide characters in the passed-in buffer. Return valuesS_OKThe call succeeded and returned the expected value or values. IMsoEnvelope ::DoDebugThe DoDebug method is a no-operation (no-op) method and always returns S_OK.SyntaxIMsoEnvelopeSiteUse the IMsoEnvelopeSite interface to let an envelope interact with a hosting application.Collapse this table
Vtable orderCollapse this table
IMsoEnvelopeSite ::RequestResizeThe RequestResize method requests that the envelope height be resized to the passed-in value.SyntaxParameterspcHeight[out][in] Height for the envelope. Return valuesThis method returns the following values:
IMsoEnvelopeSite ::CloseNoteThe CloseNote method tells the host to close the message, and the flag indicates the reason that the note is closing.SyntaxParametersgrfClose[in] Flag that indicates why the note is closing. The value can be as follows: ENV_CLOSE_SEND 0x0002 The note is closing because it was sent. Return valuesThis method returns the following values:
IMsoEnvelopeSite ::GetBodyThe GetBody method obtains the body of the note in a stream. A code page and flags are used to indicate which body to obtain and in what code page.SyntaxParameterspstm[in] Stream in which to put the body. dwCodePage [in] Code page in which to return the body. grfBody [in] Flags that indicate which body to return. The following flags can be set:
Return valuesThis method returns the following values:
IMsoEnvelopeSite ::OnEnvSetFocusThe OnEnvSetFocus method tells the host that the focus has been put into the envelope.SyntaxReturn valuesThis method returns the following values:
IMsoEnvelopeSite ::DirtytoolbarsThe DirtyToolbars method tells the host that something has changed and requires the toolbars to be updated.SyntaxReturn valuesS_OKThe call succeeded and returned the expected value or values. IMsoEnvelopeSite ::OnPropChangeThe OnPropChange method tells the host that a property has been dirtied in the envelope.SyntaxParametersdispid[in] Microsoft COM dispatch identifier of a property that was changed. Only the following value is used: dispidSomething 0xffffffff Indicates that an unspecified property has changed. Return valuesThis method returns the following values:
IMsoEnvelopeSite ::GetFrameWndThe GetFrameWnd method asks the host for the outermost frame window.SyntaxParametersphwndFrame[out] HWND of the frame window. Return valuesS_OKThe call succeeded and returned the expected value or values. IMsoEnvelopeSite ::TranslateAcceleratorsThe TranslateAccelerators method passes the accelerators to the host to be handled.SyntaxParameterspMsg[in] Message to be handed to the host. Return valuesThis method returns the following values:
IMsoComponentUse the IMsoComponent interface to let an envelope interact with a hosting application.Collapse this table
Vtable orderCollapse this table
IMsoComponent ::FDebugMessageThe FDebugMessage method is a no-operation (no-op) method and always returns S_OK.SyntaxIMsoComponent ::FPreTranslateMessageThe FPreTranslateMessage method gives components a chance to process a message before the message is translated and is dispatched. Components can perform the TranslateAccelerator method, perform the IsDialogMessage method, modify the pMsg parameter, or take some other action.SyntaxParameterspMsg[in] Message for the component to handle. Return valuesThis method returns the following values:
IMsoComponent ::OnEnterStateThe OnEnterState method is a no-operation (no-op) method and always returns S_OK.SyntaxIMsoComponent ::OnAppActivateThe OnAppActivate method is a no-operation (no-op) method and always returns S_OK.SyntaxIMsoComponent ::OnLoseActivationThe OnLoseActivation method is a no-operation (no-op) method and always returns S_OK.SyntaxIMsoComponent ::OnActivationChangeThe OnActivationChange method is a no-operation (no-op) method and always returns S_OK.SyntaxIMsoComponent ::FDoIdleThe FDoIdle method is a no-operation (no-op) method and always returns S_OK.SyntaxIMsoComponent ::FContinueMessageLoopThe FContinueMessageLoop method is a no-operation (no-op) method and always returns S_OK.SyntaxIMsoComponent ::FQueryTerminateThe FQueryTerminate method is a no-operation (no-op) method and always returns S_OK.SyntaxIMsoComponent ::TerminateThe Terminate method terminates the IMsoComponent interface’s registration. The IMsoComponent interface should revoke its registration with the component manager, release references to the component manager, and then perform any necessary cleanup.SyntaxIMsoComponent ::HwndGetWindowThe HwndGetWindow method is called to retrieve a window that is associated with the component. The IMsoComponent interface should return the desired window or return NULL if no such window exists.SyntaxParametersdwWhich[in] Indicates the window for which to obtain the HWND. The possible values are as follows:
The dwReserved parameter is reserved for future use and should be zero. Return valuesThis method returns NULL on failures. Otherwise, this method returns the requested HWND.IMsoComponentManagerUse the IMsoComponentManager interface to let an envelope interact with a hosting application.Collapse this table
Vtable orderCollapse this table
IMsoComponentManager ::FRegisterComponentThe FRegisterComponent method registers a component and the component's registration information with the component manager.SyntaxParameterspiComponent[in] The IMsoComponent object that is being registered. pcrinfo [in] The component registration information is given in following structure. [out] Cookie that identifies the component when the component calls other IMsoComponentManager interface methods. Return valuesThis method returns the following values:
IMsoComponentManager ::FRevokeComponentThe FRevokeComponent method undoes the registration of the component that is identified by the dwComponentID parameter.SyntaxParametersdwComponentID[in] ID of the component being revoked. Return valuesThis method returns the following values:
IMsoComponentManager ::FOnComponentActivateThe FOnComponentActivate method notifies the component manager that the component that is identified by the dwComponentID parameter was activated. The active component receives the change to process the messages before the messages are dispatched. Typically, the active component receives the first check at idle time after the host. The method fails when another component is already exclusively active.SyntaxParametersdwComponentID[in] ID of the component being activated. Return valuesThis method returns the following values:
IMsoEnvelopeHostUse the IMsoEnvelopeHost interface to create an envelope note.Collapse this table
Vtable orderCollapse this table
RemarksTo register as an envelope host, the application should add a key for itself under the HKEY_LOCAL_MACHINE\SOFTWARE\Clients\EnvelopeHost registry key. The key should be the application name and should have a subkey that is named CLSID. The CLSID subkey should have a default value that is created to obtain the IID_ IMsoEnvelopeHost interface.IMsoEnvelopeHost ::CreateNoteThe CreateNote method creates a new enveloped note in the host application. The application should create a new blank item and then host the envelope that is requested in the blank item.SyntaxParameterspunk[in] Not used. The value that is used should be NULL. clsidCreate [in] Class identifier (CLSID) of the envelope to create. The value that is used should be CLSID_OEEnvelope. wszTheme [in] Not used. The value that is used should be NULL. wszAuthor [in] Not used. The value that is used should be NULL. wszPrefix [in] Not used. The value that is used should be NULL. grfCreate [in] Not used. The value that is used should be 0. Return valuesThis method returns the following values:
| Article Translations
|
Back to the top
