Share via


PopulateDocumentFragment Method [Office 2003 SDK Documentation]

The PopulateDocumentFragment method specifies the content of a document fragment displayed in the Document Actions task pane. You can provide either the text (for controls specified as C_TYPE_DOCUMENTFRAGMENT) or a URL to a file that contains the text (for controls specified as C_TYPE_DOCUMENTFRAGMENTURL). Applies to controls that are specified as C_TYPE_DOCUMENTFRAGMENT or C_TYPE_DOCUMENTFRAGMENTURL.

Note  Document fragments are not available in Microsoft Office Excel 2003. You can use document fragments in Microsoft Office Word 2003 only.

Applies to

ISmartDocument

Syntax

[Visual Basic 6.0]

Private Sub ISmartDocument_PopulateDocumentFragment(ByVal ControlID As Long, ByVal ApplicationName As String, ByVal LocaleID As Long, ByVal Text As String, ByVal Xml As String, ByVal Target As Object, ByVal Props As SmartTagLib.ISmartDocProperties, DocumentFragment As String)

[Visual Basic .NET]

Public Sub PopulateDocumentFragment(ByVal ControlID As Integer, ByVal ApplicationName As String, ByVal LocaleID As Integer, ByVal [Text] As String, ByVal Xml As String, ByVal Target As Object, ByVal Props As Microsoft.Office.Interop.SmartTag.ISmartDocProperties, ByRef DocumentFragment As String) Implements Microsoft.Office.Interop.SmartTag.ISmartDocument.PopulateDocumentFragment

[C#]

public void ISmartDocument.PopulateDocumentFragment(int ControlID, string ApplicationName, int LocaleID, string Text, string Xml, object Target, Microsoft.Office.Interop.SmartTag.ISmartDocProperties Props, ref string DocumentFragment)

[Visual C++ 6.0]

STDMETHOD(PopulateDocumentFragment)(INT ControlID, BSTR ApplicationName, INT LocaleID, BSTR Text, BSTR Xml, IDispatch * Target, ISmartDocProperties * Props, BSTR * DocumentFragment)

[Visual C++ .NET]

STDMETHOD(PopulateDocumentFragment)(int ControlID, BSTR ApplicationName, int LocaleID, BSTR Text, BSTR Xml, LPDISPATCH Target, ISmartDocProperties * Props, BSTR * DocumentFragment)

Parameters

ControlID   Represents the ID number assigned to a control in the ControlID property.

ApplicationName   Specifies the name of the application. You can use the ApplicationName parameter to customize a single smart document DLL to provide smart document actions in multiple Microsoft Office applications.

LocaleID   Represents the language setting of the application. You can use the LocaleID parameter to specify different actions for multiple languages in a smart document.

Text   The text contained in the XML element with which the control is associated.

Xml   Specifies the XML element, including the markup and data, with which the control is associated.

Target   Specifies the Word or Excel Range object that represents the XML element for which the action is defined.

Props   Returns an ISmartDocProperties interface that represents the properties, such as height or width, for the control.

DocumentFragment   Represents the document fragment text or a URL to a file that contains the document fragment text. If a control is specified as C_TYPE_DOCUMENTFRAGMENT, this parameter provides the text for the document fragment. If a control is specified as C_TYPE_DOCUMENTFRAGMENTURL, this parameter provides a URL to the document that contains the text for the document fragment. The URL must be an absolute path; it cannot be a relative path.

Remarks

When you provide a URL to a document that contains a document fragment that spans more than one page, the Document Actions task pane displays only the first page of the document fragment.

From within this method, you cannot refresh the task pane by using the RefreshPane method for the SmartDocument object. If you need to refresh the task pane, use the OnPaneUpdateComplete method.

Note  The RefreshPane method and the SmartDocument object are part of the Microsoft Office Word 2003 and Microsoft Office Excel 2003 Visual Basic for Applications (VBA) object models.