VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Create a file in Microsoft Word through Visual Basic Coding

by I . NAGARAJAN (1 Submission)
Category: Windows System Services
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 2nd January 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Create a file in Microsoft Word through Visual Basic Coding

Rate Create a file in Microsoft Word through Visual Basic Coding



Dim x As Word.Document
Dim i, s As Integer
 Set x = New Word.Document
 With x.ActiveWindow.Selection
 .TypeText "This Document was Created Using VB6.0"
 .TypeText "And Microsoft Office Automation"
 .TypeParagraph
 .TypeParagraph
 .TypeText "This is Document " & Trim$(Str$(i)) & "of 10"
 .TypeParagraph
 .TypeParagraph
 .TypeText "Have a Nice Day"
 s = MsgBox("Word Document Created Successfully", vbInformation, "WD Created")
 End With
With x
 .SaveAs "C:\Visual Basic Created Me" & Trim$(Str$(i)) & "Times"
 .Close
End With
Set x = Nothing
End Sub

Private Sub ext_Click()
End
End Sub

Download this snippet    Add to My Saved Code

Create a file in Microsoft Word through Visual Basic Coding Comments

No comments have been posted about Create a file in Microsoft Word through Visual Basic Coding. Why not be the first to post a comment about Create a file in Microsoft Word through Visual Basic Coding.

Post your comment

Subject:
Message:
0/1000 characters