다음을 통해 공유


ControlCollection.AddContentControl 메서드 (String, WdContentControlType)

문서의 현재 선택 영역에 지정된 유형의 새 ContentControl을 추가합니다.

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

구문

‘선언
Function AddContentControl ( _
    name As String, _
    contentControlType As WdContentControlType _
) As ContentControl
ContentControl AddContentControl(
    string name,
    WdContentControlType contentControlType
)

매개 변수

반환 값

형식: Microsoft.Office.Tools.Word.ContentControl
문서에 추가된 ContentControl입니다.

예외

예외 상황
ArgumentNullException

name이 nullNull 참조(Visual Basic의 경우 Nothing)이거나 길이가 0인 경우

ControlNameAlreadyExistsException

이름이 같은 컨트롤이 ControlCollection에 이미 있는 경우

설명

이 메서드를 사용하여 런타임에 문서의 현재 선택 영역에 새 ContentControl을 추가합니다. 자세한 내용은 런타임에 Office 문서에 컨트롤 추가을 참조하십시오.

.NET Framework 보안

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

참고 항목

참조

ControlCollection 인터페이스

AddContentControl 오버로드

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