Private Sub CommandButton1_Click()
Dim wdoc
Dim path
Dim wdapp As Object
Application.ScreenUpdating = True
Set wdapp = CreateObject("word.Application") '创建WORD对象
path = "E:\安全部资料\量化考核\3月\量化考核表\改名后量化表\"
wjm = Dir(path & "*.doc")
Do While wjm <> ""
Set wdoc = GetObject(path & wjm) '打开WORD文件对象
With wdoc.Tables(1)
.cell(1, 1).Range.Text = "大dk " '向第一单元格写入文字
End With
wdoc.Close True '保存并关闭WORD文件
wjm = Dir()
Loop
Application.ScreenUpdating = False
wdapp.Quit '退出WORD对象
Set wdapp = Nothing
Set wdoc = Nothing
End Sub
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。