M9JOXgS7.rar
(35.03 KB, 下载次数: 49)
又重写了代码,请指点!
Private Sub CommandButton2_Click()
Dim wd As New Word.Application
Dim ra%
ra = ActiveCell.Row
wd.Documents.Add ThisWorkbook.Path + "\文书\文书.doc", False
wd.Selection.GoTo wdGoToBookmark, , , "编号"
wd.Selection.TypeText Cells(ra, 1)
wd.Selection.GoTo wdGoToBookmark, , , "代码"
wd.Selection.TypeText Cells(ra, 2)
wd.Selection.GoTo wdGoToBookmark, , , "名称"
wd.Selection.TypeText Cells(ra, 3)
wd.Selection.GoTo wdGoToBookmark, , , "日期"
wd.Selection.TypeText Cells(ra, 4)
wd.Selection.GoTo wdGoToBookmark, , , "日期2"
wd.Selection.TypeText Cells(ra, 4)
wd.Selection.GoTo wdGoToBookmark, , , "地址"
wd.Selection.TypeText Cells(ra, 5)
wd.Selection.GoTo wdGoToBookmark, , , "办理事项"
wd.Selection.TypeText Cells(ra, 6)
wd.Selection.GoTo wdGoToBookmark, , , "名称2"
wd.Selection.TypeText Cells(ra, 3)
wd.Selection.GoTo wdGoToBookmark, , , "办理事项2"
wd.Selection.TypeText Cells(ra, 6)
wd.Visible = True
End Sub
[此贴子已经被作者于2005-9-20 16:51:26编辑过] |