那我来下抛砖引玉吧 打开一个现在文档 Dim wdApp As Word.Application Dim wdDoc As Word.Document Set wdApp = CreateObject("Word.Application") '创建Word对像 wdApp.Documents.Open (sFileName) ' Set wdDoc = wdApp.Documents(sFileName) wdApp.Visible = True '是否显示文档 创建一个新的文档 Dim wdApp As Word.Application Dim wdDoc As Word.Document Set wdApp = CreateObject("Word.Application") Set wdDoc = wdApp.Documents.Add wdApp.Visible = True
保存或另保存一个文档 wdDoc.Save wdDoc.SaveAs sFileName 每一次创建或打开一个Word进程后,关闭后记释放内存 Set wdDoc = Nothing wdApp.Quit Set wdApp = Nothing
[此贴子已经被作者于2006-7-22 21:36:54编辑过] |