|
Sub yinyong3()
Dim doc As Document, d1 As Document, d2 As Document
Dim tx, tv
Set doc = ThisDocument
tx = doc.Tables(4).Cell(2, 1).Range.Text
tv = doc.Tables(4).Cell(3, 1).Range.Text
tx = VBA.Left(tx, Len(tx) - 2)
tv = VBA.Left(tv, Len(tv) - 2)
tx = doc.Path & "\" & tx & ".docx"
tv = doc.Path & "\" & tv & ".docx"
If Dir(tx) <> "" Then
Set d1 = Documents.Open(tx)
d1.Content.Copy
d1.Close
doc.Activate
doc.Bookmarks("估价方法开始").Select
Selection.Move Unit:=wdLine, Count:=1
Selection.Paste
End If
If Dir(tv) <> "" Then
Set d2 = Documents.Open(tv)
d2.Content.Copy
d2.Close
doc.Bookmarks("估价方法开始").Select
Selection.Move Unit:=wdLine, Count:=1
Selection.Paste
End If
End Sub
不知道我是否理解的正确。 |
|