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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a New word doc, allow user to edit, then save as.

Status
Not open for further replies.

frozedog

IS-IT--Management
Apr 18, 2002
10
US
I am using the following code to attempt to open word with a new doc, save it with the specified name, and then edit the doc. When user closes the doc after updates it would prompt for user to save and it would already have the file named. I cannot a blank word doc open. This code only opens word with NO blank document available. Hope this makes some sense.
 
I am using the following code
Which code ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks PHV, I ws able to get it working. Not sure why my code did not display Here it is again. I went about this in a different way but still think this should work

Dim oApp As Object
Dim WordDoc As Object
Set oApp = CreateObject("Word.Application")
Set WordDoc = CreateObject("Word.document")
WordDoc.Application.Visible = True
WordDoc.SaveAs "P:\My Documents\TS-" & Me.Scriptnum & ".doc
 
What about this ?
Dim oApp As Object
Dim WordDoc As Object
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
Set WordDoc = oApp.Documents.Add()
WordDoc.SaveAs "P:\My Documents\TS-" & Me.Scriptnum & ".doc"


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top