-
Are you trying to do something like this?
[vba]
Dim objWord
Dim Doc
Dim Modul
Dim MyText
Set objWord = CreateObject ( "Word.Application" )
Set Doc = Objword.Documents.Add
Set Modul = Doc.VBProject.VBComponents.Add(1)
MyText = "Line1" & vbNewLine & _
"Line2" & vbNewLine & _
"Line3" & vbNewLine & _
"Line4" & vbNewLine
Modul.CodeModule.AddFromString (MyText)
Doc.SaveAs "c:\tstWord.doc"
Doc.Close
objword.Quit
[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules