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
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