没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Sub 标记文献()
'
' 标记文献 Macro
' 宏在 2006-10-2 由 cs 录制
ActiveWindow.ActivePane.View.ShowAll = True
ss = Selection.Text
Selection.Delete
ll = Len(ss)
ss = Left(ss, ll)
ll = Len(ss)
ss = Right(ss, ll)
ActiveDocument.TablesOfAuthorities.MarkCitation Range:=Selection.Range, _
ShortCitation:="", LongCitation:=ss, _
LongCitationAutoText:="", Category:=3 '
End Sub
Sub 建立目录()
'
' 建立目录 Macro
' 宏在 2006-10-8 由 cs 录制
With ActiveDocument
.TablesOfAuthorities.Add Range:=Selection.Range, Category:=3, Passim _
:=True, KeepEntryFormatting:=True, IncludeCategoryHeader:=False
num = .TablesOfAuthorities.Count
Set myrange = .TablesOfAuthorities(num).Range
cc = myrange.Paragraphs.Count
For i = cc - 1 To 2 Step -1
Set rr = myrange.Paragraphs(i).Range
rr.Delete
Next
ll = 1
'
' 标记文献 Macro
' 宏在 2006-10-2 由 cs 录制
ActiveWindow.ActivePane.View.ShowAll = True
ss = Selection.Text
Selection.Delete
ll = Len(ss)
ss = Left(ss, ll)
ll = Len(ss)
ss = Right(ss, ll)
ActiveDocument.TablesOfAuthorities.MarkCitation Range:=Selection.Range, _
ShortCitation:="", LongCitation:=ss, _
LongCitationAutoText:="", Category:=3 '
End Sub
Sub 建立目录()
'
' 建立目录 Macro
' 宏在 2006-10-8 由 cs 录制
With ActiveDocument
.TablesOfAuthorities.Add Range:=Selection.Range, Category:=3, Passim _
:=True, KeepEntryFormatting:=True, IncludeCategoryHeader:=False
num = .TablesOfAuthorities.Count
Set myrange = .TablesOfAuthorities(num).Range
cc = myrange.Paragraphs.Count
For i = cc - 1 To 2 Step -1
Set rr = myrange.Paragraphs(i).Range
rr.Delete
Next
ll = 1
For Each afield In ActiveDocument.Fields
If afield.Type = wdFieldTOAEntry Then
ss = afield.Code
'deal ss
ss = Right(ss, Len(ss) - 8)
ss = Left(ss, Len(ss) - 7)
If ll = 1 Then
Set rr = myrange.Paragraphs(1).Range
Set ff = rr.Find
ff.Execute findtext:=rr.Text, Replacewith:=ss + "^p", Replace:=wdReplaceAll
ll = 2
Else
'check repeat
bb = False
For h = 1 To ll - 1
Set rr = myrange.Paragraphs(h).Range
sa = rr.Text
sa = Left(sa, Len(sa) - 1)
If sa = ss Then bb = True
Next
If bb = False Then
Set rr = myrange.Paragraphs(ll - 1).Range
Set ff = rr.Find
ff.Execute findtext:="^p", Replacewith:="^p" + ss + "^p", Replace:=wdReplaceAll
ll = ll + 1
End If
End If
End If
Next afield
If afield.Type = wdFieldTOAEntry Then
ss = afield.Code
'deal ss
ss = Right(ss, Len(ss) - 8)
ss = Left(ss, Len(ss) - 7)
If ll = 1 Then
Set rr = myrange.Paragraphs(1).Range
Set ff = rr.Find
ff.Execute findtext:=rr.Text, Replacewith:=ss + "^p", Replace:=wdReplaceAll
ll = 2
Else
'check repeat
bb = False
For h = 1 To ll - 1
Set rr = myrange.Paragraphs(h).Range
sa = rr.Text
sa = Left(sa, Len(sa) - 1)
If sa = ss Then bb = True
Next
If bb = False Then
Set rr = myrange.Paragraphs(ll - 1).Range
Set ff = rr.Find
ff.Execute findtext:="^p", Replacewith:="^p" + ss + "^p", Replace:=wdReplaceAll
ll = ll + 1
End If
End If
End If
Next afield
剩余6页未读,继续阅读
资源评论
cs77334781
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功