次の方法で共有


Window.SelectedValidationIssue Property (Visio)

Gets or sets the validation issue that is selected in the Issues window. Read/write.

Version Information

Version Added: Visio 2010

Syntax

expression .SelectedValidationIssue

expression A variable that represents a Window object.

Return Value

ValidationIssue

Remarks

Attempting to get or set the SelectedValidationIssue property on a window other than the Issues window, or when the Issues window is closed, returns an error.

If multiple issues are selected in the Issues window, Visio returns the issue that has the focus.

If no issue is selected, Visio returns Nothing. By default, issues that you have specified to be ignored are not displayed. If you set the property to Nothing, Visio clears the selection in the Issues window.

Example

The following Visual Basic for Applications (VBA) example shows how to use the SelectedValidationIssue property to get the validation issue that is currently selected in the Issues window. If no issue is selected, the code displays a message box prompting the user to select an issue.

Set vsoIssuesWindow = Application.ActiveWindow.Windows.ItemFromID(Visio.VisWinTypes.visWinIDValidationIssues)
    
' If the Issues window is visible, find the selected validation issue.
    If vsoIssuesWindow.Visible Then
       Set vsoValidationIssue = vsoIssuesWindow.SelectedValidationIssue
    End If
    
' Respond to the case when no validation issue is selected. 
    If vsoValidationIssue Is Nothing Then
        MsgBox "Please select an issue."
    End If