星期五, 12月 25, 2015
星期三, 12月 16, 2015
word vba
Sub ListUsedBookmark()
'
' ListNotUsedBookmark 巨集
'
'
Dim oField As Field
Dim sCode As String
Dim bFoundOne As String
For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldSequence Then
sCode = oField.Code
' If InStr(sCode, "ref") <> 0 Then
' If oField.Result.Text = "57" Then
' Debug.Print oField.Result.Text
' End If
' End If
End If
'找出有cite到的reference
If oField.Type = wdFieldRef Then
sCode = oField.Code
If InStr(sCode, "REF") <> 0 Then
Debug.Print oField.Result.Text
End If
End If
Next
End Sub
'
' ListNotUsedBookmark 巨集
'
'
Dim oField As Field
Dim sCode As String
Dim bFoundOne As String
For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldSequence Then
sCode = oField.Code
' If InStr(sCode, "ref") <> 0 Then
' If oField.Result.Text = "57" Then
' Debug.Print oField.Result.Text
' End If
' End If
End If
'找出有cite到的reference
If oField.Type = wdFieldRef Then
sCode = oField.Code
If InStr(sCode, "REF") <> 0 Then
Debug.Print oField.Result.Text
End If
End If
Next
End Sub
訂閱:
文章 (Atom)