最近很忙,所以也没有更多的时间上论坛了。 请参考: '* +++++++++++++++++++++++++++++ '* Created By SHOUROU@ExcelHome 2007-3-16 6:09:53 '仅测试于System: Windows NT Word: 11.0 Language: 2052 '№ 0179^The Code CopyIn [ThisDocument-ThisDocument]^' '* ----------------------------- Sub Example() Dim myRange As Range, i As Endnote Application.ScreenUpdating = False For Each i In ActiveDocument.Endnotes With i.Range .Find.Execute findtext:="[", replacewith:="[", Replace:=wdReplaceAll .Find.Execute findtext:="]", replacewith:="]", Replace:=wdReplaceAll .Find.Execute findtext:="^l", replacewith:="♀^p", Replace:=wdReplaceAll .InsertAfter "♀" End With Next Application.ScreenUpdating = True End Sub '----------------------
Sub Example2() Dim myRange As Range, i As Endnote Application.ScreenUpdating = False Again: With ActiveDocument.StoryRanges(wdEndnotesStory).Find .Execute findtext:="[", replacewith:="[", Replace:=wdReplaceAll .Execute findtext:="]", replacewith:="]", Replace:=wdReplaceAll .Execute findtext:="^l", replacewith:="♀^p", Replace:=wdReplaceAll Set myRange = ActiveDocument.StoryRanges(wdEndnotesStory) While Not (myRange.NextStoryRange Is Nothing) GoTo Again Wend End With For Each i In ActiveDocument.Endnotes i.Range.InsertAfter "♀" Next Application.ScreenUpdating = True End Sub '----------------------
在你提供的尾注文本中,"^p"是一个可查找内容,但不是一个可以替换的内容,可以从 i.Range.InsertAfter "♀"看出. 正常的尾注文本和脚注文本是可以替换的段落标记的.
[此贴子已经被作者于2007-3-16 6:19:59编辑过] |