Home Word VB/VBA Create word document
20 | 05 | 2012
This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade

Create word document PDF Print E-mail
User Rating: / 0
PoorBest 
Tutorials

The code below creates a new word document (including the posibility for a template use). 

Show/Hidden vbnet code

View source
Sub CreateNewWordDoc()
 
 
 
	Dim wrdApp As Word.Application
 
	Dim wrdDoc As Word.Document
 
	Dim i As Integer
 
	Dim txtstring As String
 
	Dim txtreplace As String
 
 
 
	Set wrdApp = CreateObject("Word.Application")
 
	wrdApp.Visible = True
 
	Set wrdDoc = wrdApp.Documents.Add '("c:\Template.dotx")
 
 
 
	wrdApp.Selection.Text = "This new document is created thanks to visiblevisual.com. Enjoy!!"
 
 
 
	Set wrdDoc = Nothing
 
	Set wrdApp = Nothing
 
 
 
	End Sub
 
 

Attachments:
FileDescriptionFile sizeDownloads
Download this file (Create Word Document VBA.xls)Create word documentCreate word documen40 Kb111
 
This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade