Imports Microsoft.Office.Interop.Word
Public Class AspNetAspWriteWord
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim Wrd As New Microsoft.Office.Interop.Word.Application
Dim DocName As String = "MyDoc/MyWord.doc"
Wrd.Application.Visible = False
Wrd.Documents.Add()
With Wrd
.Selection.TypeText("Welcome To www.ThaiCreate.Com")
End With
Wrd.ActiveDocument.SaveAs(Server.MapPath(DocName))
Wrd.Application.Quit()
Wrd = Nothing
End Sub
End Class