|
楼主 |
发表于 2012-11-24 11:19
|
显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub 依次查找书签名()
If ActiveDocument.Bookmarks.Count >= 1 Then
ReDim aMarks(ActiveDocument.Bookmarks.Count - 1)
i = 0
Dim label As Control
Dim box As Control
For Each aBookmark In ActiveDocument.Bookmarks
aMarks(i) = aBookmark.Name
MsgBox (aMarks(i))
Dim caption As String
caption = ActiveDocument.Bookmarks(1).Range.Text
' Set label = Me.Controls.Add("Forms.Label.1", "Label" & i, True)
' MsgBox (label.Name)
' label.Left = 10
' label.Top = 10
' label.caption = caption
' Set box = Me.Controls.Add("Forms.TextBox.1", "TextBox1" & i, True)
' box.Left = 10
' box.Top = 10
' box.Left = 50
' i = i + 1
Next aBookmark
End If
End Sub |
|