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

Getting SaveAs method to prompt. Also opening multiple docs in Word 97 1

Status
Not open for further replies.

tyhand

Programmer
Jul 3, 2002
186
US
Hey all,

Is there a way to force the SaveAs method to prompt me if a file is already saved in a folder?

I have several existing documents and I want to change their file names and save them to another folder using Word 97.

I'm using the saveas method, but it doesn't let me know if the file already exists in the destination folder. By default, the saveas method doesn't issue a prompt if the doc is already saved, it just overrides it. Is there a way to programmatically do this?

Also, can Word 97 open an unlimited number of documents simultaneously? At the very least, can it open more than 17 documents? I'm trying to open 25 small text docs at the same time using Word 97, but it only let's me open 17 at one time. Don't know why. Is there a way to get it to open more?

Thanks for help. Peace!

Thank You Have A Nice Day
*****TYHAND [wink]
 
Mike - I believe Tyhand wants to do the SaveAs programmatically, without user intervention, and doesn't want to invoke the built-in SaveAs dialog.

Tyhand - Use the following code, which I've modified from John Walkenbach's "Spreadsheet Page" to detect if the file exists prior to invoking the SaveAs method:

Code:
If Right(Path, 1) <> &quot;\&quot; Then Path = Path & &quot;\&quot;
If Dir(Path & FName) <> &quot;&quot; Then
  msg = &quot;File &quot; &Path &FName &&quot; already exists!&quot;
  msg = msg & vbCrLf & vbCrLf &&quot; Overwrite?&quot;
  retVal = MsgBox( msg, vbExclamation + vbYesNo, &quot;Save As&quot; )
  IF retVal = vbNo Then
    Exit Sub
  End If
End If

ThisDocument.SaveAs FName ...

HTH
M. Smith
 
Thanks rmikesmith!

I did a couple of modifications and it worked like a charm!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top