Share via


Understanding the Smart Document API [Office 2003 SDK Documentation]

When you are developing a smart document, it is important to understand exactly how the ISmartDocument interface builds each of the controls in the Document Actions task pane as you have them defined in your smart document code.

Although the methods in the API are executed in a specific order to render your actions in the Document Actions task pane, many of the properties in the API are dynamic. For example, the caption on a list box may change depending on the contents of a document or even depending on the value in another smart document control.

The following diagram illustrates the process that the host application follows when it loads the dynamic-link library (DLL) that implements the Smart Document API. This diagram is described below.

  • When a smart document is first initialized, steps 1 through 4 are executed in order to provide the initial layout of the task pane.

  • When the location of the insertion point changes within the document, steps 3 and 4 are executed in order to redraw the actions, which are now in scope as determined by the XML structure.

    Note  At any time, you can use the Visual Basic for Applications object model for the host application to invoke steps 3 and 4 without moving the insertion point. This is useful when the invocation of one control should cause a change to another. For more information, see Working with the Visual Basic for Applications Object Models.

  • When a control is invoked (for example, clicked, typed in, and so on), the appropriate method from step 5 is executed to perform the actions.