Set m_newdoc = wdapp.Documents.add(DocumentType:=wdNewBlankDocument) Set m_tmpdoc = wdapp.Documents.add(DocumentType:=wdNewBlankDocument)
.....
m_tmpdoc全部复制到m_newdoc?
谢谢
...全文
1102打赏收藏
如何控制word文档-选中并复制当前文档的全部,并粘贴到另外的一个文档
Set m_newdoc = wdapp.Documents.add(DocumentType:=wdNewBlankDocument) Set m_tmpdoc = wdapp.Documents.add(DocumentType:=wdNewBlankDocument) ..... m_tmpdoc全部复制到m_newdoc? 谢谢
'开始写字段
Dim ncount As Integer
ncount = adoRS.RecordCount
For i = 0 To ncount
nField = adoRS.Fields.Count
m_dotfile.Activate
m_dotfile.Bookmarks("all").Select
m_dotfile.ActiveWindow.Selection.Copy
m_tmpdoc.Activate
m_tmpdoc.ActiveWindow.Selection.Paste
For j = 0 To nField
sfield = adoRS.Fields.Item(j).Name
'查找是否有对应书签
If (m_tmpdoc.Bookmarks.Exists(sfield)) Then
m_tmpdoc.Bookmarks(sfield).Range.Text = adoRS.Fields(sfield).Value
End If
Next j