P
Peter Stone
Access 2003/XP Pro
I'm opening a Word document, typing some text, and trying to rename it using
text from a combo and a text box on my form. The first two steps work OK, but
when I try to rename the document, it comes up with a message box "Object
required ".
Dim oWord As Object
Dim oDoc As Object
'Create the Word application object.
Set oWord = CreateObject("Word.Application")
'Open the sample document.
Set oDoc = oWord.Documents.Add("C:\t2hDoc\DocBlank.doc")
'Add text
oWord.Selection.TypeText "Start here."
'Save the new document
oWord.ActiveDocument.SaveAs Filename:="t2h" &
Me.Parent!cboDestL.Column(1).Value & Me.Parent!txtHd.Value & ".doc"
oWord.Visible = True
Thanks in advance
Peter
I'm opening a Word document, typing some text, and trying to rename it using
text from a combo and a text box on my form. The first two steps work OK, but
when I try to rename the document, it comes up with a message box "Object
required ".
Dim oWord As Object
Dim oDoc As Object
'Create the Word application object.
Set oWord = CreateObject("Word.Application")
'Open the sample document.
Set oDoc = oWord.Documents.Add("C:\t2hDoc\DocBlank.doc")
'Add text
oWord.Selection.TypeText "Start here."
'Save the new document
oWord.ActiveDocument.SaveAs Filename:="t2h" &
Me.Parent!cboDestL.Column(1).Value & Me.Parent!txtHd.Value & ".doc"
oWord.Visible = True
Thanks in advance
Peter