Open a new doc and save

J

J.J. Kayande

I'm trying to open a new document and bring up the File
Save As dialog to save it. I'm having problems reliably
activating the new document instead of the original
document I'm starting from. This is the code I'm using
right now (mostly gleaned from the Microsoft MVP site):

Dim docMyName As String
docMyName = "My Name"

Documents.Add DocumentType:=wdNewBlankDocument
Windows(1).Activate

With Dialogs(wdDialogFileSaveAs)
.Name = docMyName
.Show
End With

I am running MS Word 2002 on Windows 2000.
J.J. Kayande
 
G

Greg Maxey

JJ

Try taking out the 'Windows(1).Activate

Sub Test()
Dim docMyName As String
docMyName = "My Name"

Documents.Add DocumentType:=wdNewBlankDocument
With Dialogs(wdDialogFileSaveAs)
.Name = docMyName
.Show
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top