Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

writing to word 2

Status
Not open for further replies.

russellmunday

Technical User
Jul 24, 2003
87
GB
I have a program that needs to write the contents of a string to a Microsoft Word file and save it, the problem is i can not see any write command has anyone done this before that could show me please.
 
Here is the short code:
Code:
        Dim oWord As Word.Application
        Dim oDoc As Word.Document
        oWord = CreateObject("Word.Application")
        oWord.Visible = True
        oDoc = oWord.Documents.Add
        oDoc.Range.Text = "My text"
        oDoc.SaveAs("c:\test.doc")
        oWord.Application.Quit()

__________________________________________
Try forum1391 for lively discussions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top