VB.NET操作Word大全

VB.NET操作Word之1,在project\references 中加入microsoft word 11.0 object library  (2003)

一、启动打开Word文档

Dim oWord As Word.Application
Dim oDoc As Word.Document
oWord = New Word.Application
oWord.Visible = False
oDoc = oWord.Documents.Open(FileName:=FilePath)
二、关闭word文档

oWord.Quit()
oWord = Nothing
三、需要导入的内容

Imports Microsoft.Office.Interop
Imports Microsoft.Office.Interop.Word.WdColor






你可能感兴趣的:(Office操作技巧,C#)