다음을 통해 공유


Document.ActiveWritingStyle 속성

문서에서 지정된 언어의 문장체를 가져옵니다.

네임스페이스:  Microsoft.Office.Tools.Word
어셈블리:  Microsoft.Office.Tools.Word(Microsoft.Office.Tools.Word.dll)

구문

‘선언
ReadOnly Property ActiveWritingStyle As Document_ActiveWritingStyleType
    Get
Document_ActiveWritingStyleType ActiveWritingStyle { get; }

속성 값

형식: Microsoft.Office.Tools.Word.Document_ActiveWritingStyleType
문서에서 지정된 언어의 문장체를 지정하는 문자열

설명

ActiveWritingStyle 속성은 다음 매개 변수와 함께 사용할 수 있습니다.

Parameter

설명

LanguageID

지정된 문서에서 문장체를 설정할 언어를 지정하는 WdLanguageID 값 중 하나입니다.

매개 변수를 지정하지 않고 ActiveWritingStyle 속성을 사용하는 경우 코드에서 직접 사용하지 않는 Document_ActiveWritingStyleType 개체를 반환합니다.

사용할 수 있는 쓰기 스타일 목록을 가져오려면 WritingStyleList 속성을 사용합니다.

예제

다음 코드 예제에서는 현재 선택된 텍스트의 문장체를 표시합니다. 이 예제는 응용 프로그램 수준 추가 기능을 위한 것입니다.

Private Sub DocumentActiveWritingStyle()
    Dim vstoDoc As Document = Globals.Factory.GetVstoObject(Me.Application.ActiveDocument)
    System.Windows.Forms.MessageBox.Show(vstoDoc.ActiveWritingStyle( _
        vstoDoc.Application.Selection. _
        LanguageID).ToString())
End Sub
private void DocumentActiveWritingStyle()
{
    Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
    System.Windows.Forms.MessageBox.Show(vstoDoc.ActiveWritingStyle[vstoDoc.Application. 
        Selection.LanguageID].ToString());
}

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

Document 인터페이스

Microsoft.Office.Tools.Word 네임스페이스