Anh chị giúp em giải thích code này với

Liên hệ QC

tvl297

Thành viên hoạt động
Tham gia
27/5/08
Bài viết
139
Được thích
88
Nghề nghiệp
Kế toán
Sub Set_TB()
Dim Dc As Object, Hd As Object, Sh As Shape, i
Dim Cl As Range
Dim Tm1, Tm2
On Error Resume Next
Set Dc = CreateObject("Word.Application")
Dc.Documents("Hopdonglaodong-01.doc").Close
Dc.Visible = True
Set Hd = Dc.Documents.Open(ThisWorkbook.Path & "\Hopdonglaodong-01.doc")
For i = 1 To Hd.Shapes.Count
Hd.Shapes(1).Select
Hd.Shapes(1).Delete
Next
i = 0
For Each Cl In Sheet2.Range(Sheet2.[A1], Sheet2.[A65536].End(3))
i = i + 1
With Hd.Shapes.AddTextbox(msoTextOrientationHorizontal, 10, 10 + i * 20, 168#, 25#)
.Name = Cl.Value
.TextFrame.TextRange = Cl.Value
.Line.Visible = msoFalse
.Fill.Visible = msoFalse
.Font = "Times New Roman"
End With
Next
i = 0
For Each Cl In Sheet1.Range(Sheet1.[A1], Sheet1.[A1].End(2))
i = i + 1
With Hd.Shapes.AddTextbox(msoTextOrientationHorizontal, 550, 10 + i * 20, 168#, 25#)
.Name = Cl.Value
.TextFrame.TextRange = Cl.Value
.Line.Visible = msoFalse
.Fill.Visible = msoFalse
.Font = "Times New Roman"
End With
Next
End Sub
 
Web KT
Back
Top Bottom