Sub Createwordapp()
Dim wdapp As Object
Dim wddoc As Object
'**** Creating word application object ********
Set wdapp = CreateObject("Word.application")
'**** Adding new document to word document *******
wdapp.documents.Add
'**** Making word application visible ********
wdapp.Visible = True
'**** Adding Text to document ************
With wdapp.Selection
.typetext Text:="This is my document"
.typeparagraph
.typetext Text:="Thank You"
.typeparagraph
End With
' **** Prompting and saving word document *********
wdapp.activedocument.SaveAs Application.GetSaveAsFilename(InitialFileName:="Doc1", filefilter:="word document (*.doc),*.doc")
'**** Closing word document *******
wdapp.activedocument.Close
'**** closing word application *******
wdapp.Quit
End Sub