象楼主6楼提供的附件,是不适合用于这类文档的(段落文字数量过多),我做了一个代码,可以生成中英对照(隔段翻译)的代码和附件,供楼主以后参考。 '* +++++++++++++++++++++++++++++
'* Created By I Love You_Word!@ExcelHome 2005-9-13 09:31:54
'仅测试于System: Windows NT Word: 10.0 Language: 2052
'№ 00018^The Code CopyIn [ThisDocument-ThisDocument]^'
'* -----------------------------
Option Explicit
Sub MergeCE()
Dim DocA As Document, DocB As Document, ParA As Paragraph, i As Integer
Dim PasteRange As Range
'定义两个文档对象
Set DocA = Documents("兽药管理条例.Doc")
Set DocB = Documents("Regulations on Administration of Veterinary Drugs.Doc")
With ThisDocument
For Each ParA In DocA.Paragraphs '在文档A段落中循环
i = i + 1 '累加
ParA.Range.Copy '段落RANGE对象的复制
'始终是文档结束标记前一个字符位置
Set PasteRange = .Range(.Content.End - 1, .Content.End - 1)
'保留源格式的粘贴
PasteRange.PasteAndFormat (wdFormatOriginalFormatting)
Set PasteRange = .Range(.Content.End - 1, .Content.End - 1)
DocB.Paragraphs(i).Range.Copy '复制文档B中的RANGE对象
PasteRange.PasteAndFormat (wdFormatOriginalFormatting)
Next
End With
End Sub
'----------------------
tJSM7fV2.zip
(49.29 KB, 下载次数: 69)
[此贴子已经被作者于2005-9-13 9:37:24编辑过] |