DocumentBase.StyleSortMethod 속성

정의

스타일 작업 창에서 스타일을 정렬할 때 사용할 정렬 방법을 지정하는 값을 가져오거나 설정합니다.

public:
 property Microsoft::Office::Interop::Word::WdStyleSort StyleSortMethod { Microsoft::Office::Interop::Word::WdStyleSort get(); void set(Microsoft::Office::Interop::Word::WdStyleSort value); };
public Microsoft.Office.Interop.Word.WdStyleSort StyleSortMethod { get; set; }
member this.StyleSortMethod : Microsoft.Office.Interop.Word.WdStyleSort with get, set
Public Property StyleSortMethod As WdStyleSort

속성 값

WdStyleSort 값 중 하나입니다.

예제

다음 코드 예제에서는 스타일 작업창에 대한 현재 정렬 메서드를 표시합니다. 다음으로, 현재 정렬 메서드가 사전순 정렬 메서드가 아닌 경우 코드는 정렬 메서드가 수정될 예정임을 사용자에게 알리는 메시지를 표시한 다음 정렬 메서드를 사전순 정렬 순서로 수정합니다. 이 예제를 사용하려면 문서 수준 프로젝트의 클래스에서 ThisDocument 실행합니다.

private void SetStyleSortOrder()
{
    MessageBox.Show("Current sort method for the styles task pane is: " 
        + this.StyleSortMethod.ToString());
    if (this.StyleSortMethod != Word.WdStyleSort.wdStyleSortByName)
    {
        MessageBox.Show("Changing sort method to "
            + Word.WdStyleSort.wdStyleSortByName.ToString()
            + " to sort styles alphabetically in the styles "
            + "task pane.");
        this.StyleSortMethod = Word.WdStyleSort.wdStyleSortByName;
    }            
}
Private Sub SetStyleSortOrder()
    MessageBox.Show("Current sort method for the styles task pane is: " _
            + Me.StyleSortMethod.ToString())
    If Me.StyleSortMethod <> Word.WdStyleSort.wdStyleSortByName Then
        MessageBox.Show("Changing sort method to " _
            + Word.WdStyleSort.wdStyleSortByName.ToString() _
            + " to sort styles alphabetically in the styles " _
            + "task pane.")
        Me.StyleSortMethod = Word.WdStyleSort.wdStyleSortByName
    End If
End Sub

적용 대상