0
일반 VBA에 익숙하지 않거나 Range로 작업하고 있습니다. 텍스트 줄 뒤에 확인란을 추가하고 싶지만 다음 코드는 문서의 맨 끝에있는 모든 확인란을 출력합니다. 확인란을 설정하는 범위 매개 변수를 고정해야한다고 생각하지만이를 식별하는 방법을 모르겠습니다. 문제는 체크 박스 문서의 마지막에 첨가하는 것이 아니지만은 (문서의 단부와 동일) 현재 선택/삽입 지점 후에 추가되는 것을Word-VBA : 체크 박스 범위
'http://wordribbon.tips.net/T010727_Inserting_Multiple_Graphics_in_a_Document.html
Sub GenerateLab()
Dim sPic As String
Dim sPath As String
sPath = "C:\Users\lab\Documents\PDF Gen 12-1\TestImages\"
sPic = Dir(sPath & "*.png")
Do While sPic <> ""
Selection.TypeText ("Is this an ***?")
Selection.TypeParagraph
Selection.TypeText ("***")
Dim objCC As ContentControl
Set objCC = ActiveDocument.ContentControls _
.Add(wdContentControlCheckBox)
Selection.TypeParagraph
Selection.TypeText ("Not ***")
Dim objCC2 As ContentControl
Set objCC2 = ActiveDocument.ContentControls _
.Add(wdContentControlCheckBox)
Selection.InlineShapes.AddPicture _
FileName:=sPath & sPic, _
LinkToFile:=False, SaveWithDocument:=True
sPic = Dir
Selection.InsertBreak (7)
Loop
End Sub