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

to save a doc file at runtime

Status
Not open for further replies.

rumman

Programmer
Feb 10, 2002
20
0
0
US
dear expert,

i opened a word document at runtime and wrote a some text into it.the following was the code i used....but this doc gets saved in the personal folder.can i make it save in a place i wish to?

i also tried .saveas, it saved but format changed a bit
i saved the second time it said one file already open(some silly error i guess)

===========================================================
If appword.Documents.Count = 0 Then
appword.Documents.Add
End If

appword.Documents(1).PageSetup.Orientation = wdOrientLandscape
appword.Documents(1).Range.Font.Size = 6
appword.Documents(1).Range.Font.Bold = True
appword.Documents(1).Range.Font.Name = "ariel"

appword.Documents(1).Range.InsertAfter s

set wDoc = appword.Document(1)
wDoc.saveas ("path")
wDoc.Close

thankyou for your time
rumman
 
You could try using a common dialog box (show save method) to specify a path and/or locatiobn to save the file. Then replace your "path" variable with the path retuened from the common dialog box. Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top