SmartDocument.PickSolution method (Office)
Displays a dialog box that allows the user to choose an available XML expansion pack to attach to the active document in Microsoft Word or to a workbook in Microsoft Excel.
Syntax
expression.PickSolution (ConsiderAllSchemas)
expression A variable that represents a SmartDocument object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
ConsiderAllSchemas | Optional | Boolean | True displays all available XML expansion packs installed on the user's computer. False displays only XML expansion packs applicable to the active document. Default value is False. |
Remarks
Use the PickSolution method to allow the user to select an XML expansion pack from a list. The schema attached to the active document or workbook determines which XML expansion packs are applicable.
The PickSolution method does not return a value to indicate whether the user selected an XML expansion pack or chose Cancel in the dialog box. Check the SolutionID property after calling PickSolution to determine whether an XML expansion pack has been attached.
If the smart document developer has failed to specify "targetApplication" in the XML expansion pack manifest file, the list displayed by PickSolution may include XML expansion packs that are not targeted to the active application; for example, an Excel user may see XML expansion packs targeted exclusively to Word. In these circumstances, the user may select an XML expansion pack that is not appropriate for the active application.
For more information about smart documents or XML expansion packs for smart documents, see the Smart Document Software Development Kit (SDK).
Example
The following example checks the SolutionID property to determine whether the active Microsoft Word document already has an attached XML expansion pack; if not, it displays a dialog box that allows the user to choose an available XML expansion pack. It then displays the properties of the smart document.
Dim objSmartDoc As Office.SmartDocument
Dim strSmartDocInfo As String
Set objSmartDoc = ActiveDocument.SmartDocument
If objSmartDoc.SolutionID = "None" Or objSmartDoc.SolutionID = "" Then
objSmartDoc.PickSolution True
End If
If objSmartDoc.SolutionID > "None" And objSmartDoc.SolutionID > "" Then
strSmartDocInfo = "SolutionID: " & objSmartDoc.SolutionID & vbCrLf & _
"SolutionURL: " & objSmartDoc.SolutionURL
MsgBox strSmartDocInfo, vbInformation + vbOKOnly, "Smart Doc Properties"
Else
MsgBox "The user clicked Cancel."
End If
Set objSmartDoc = Nothing
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.