2016-10-18 2 views
0

나는 이것을 위해 높고 낮음을 찾았지만 행운은 없습니다. 체크 박스와 관련된 몇 가지 속성이있다, 그러나VBA 단어 2010로 ActiveX 확인란 속성 설정

Selection.InlineShapes.AddOLEControl ClassType:="Forms.CheckBox.1" 

, 그리고 내가 체크 박스를 만드는 오전 때뿐만 아니라 그들을 설정하는 방법을 알아 싶었 :

은 체크 박스를 만듭니다.

예를 들어,이 시도 :

Selection.InlineShapes.AddOLEControl ClassType:="Forms.CheckBox.1", Caption:="" 

을하지만 코드는 캡션을 강조하면서 오류에 "찾을 수 없음 명명 된 인수를"발생합니다 : = ""

답변

0

누군가를 위해 같은 문제를

'to place it in the table, assuming only 1 table, and in this example the checkbox is placed in the second Row, first Column 
ActiveDocument.Tables(1).Cell(2, 1).Select 

Set myOB = Selection.InlineShapes.AddOLEControl(ClassType:="Forms.CheckBox.1") 
With myOB.OLEFormat 
.Activate 
Set myObj = .Object 
End With 
With myObj 
'now you can name the field anything you want 
.Name = "CB1" 
.Value = False 
'delete the caption, or have it say what you want 
.Caption = "" 
.Height = 22 
.Width = 22 
End With