Create New WordDocument using VB.Net.

This code is used to create new word document in windows application.
First You will add microsoft.office.core reference in your project
then You will imports--> imports microsoft.office.introp



add reference-->microsoft.office.core

imports microsoft.office.introp

Private Sub loadword()
Dim wd As New Word.Application
Dim docu As Word.Document
Dim newTemplate As Object = True
Dim docType As Object = 0
Dim isVisible As Object = True
Dim filename As String = "C:/normal.doc"
docu = wd.Documents.Add(filename, newTemplate, docType, isVisible)
wd.Visible = True
wd.Activate()
End Sub


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: