on close save as x

C

Curt

is there a way to save a document by given name(X) on close. This document is
opened for changes to be attached to an e-mail. Want to save as on close so
origional stays as is. Want user to make any changes then click close and
have it save as (X)
Thanks
 
C

Curt

Guess I didn't state my self clear enough.Looked at the sub recommended. What
I wish to do is to get it to activate when the close button is clicked on. I
know how to do it in excel but not in word. Have tried the following with no
luck copyed this from excel sheet.

Private Sub Document_BeforCloseel As Boolean)

ThisDocument.SaveAs ("c:\parade\X.doc")
(worksheet)
End Sub
 
C

Curt

Sub SaveIncrementedFilename()
Dim PathAndFileName As String, n As Long
PathAndFileName = "C:\Parade\E-Mail Attachment.doc"
If Dir("C:\Parade\E-mail Attachment" & ".doc") = "" Then
ActiveDocument.SaveAs ("C:\Parade\E-Mail Attachment.doc" & ".doc")
Else
n = 1
Do While Dir("C:\Parade\E-mail Attachment.doc & n & "".doc") <> ""
n = n + 1
Loop
ActiveDocument.SaveAs PathAndFileName & n & ".doc"
End If
End Sub

Novice as I am did something wrong as not saving
Thanks
 
C

Curt

With the two sites you sent I was able then to solve the problem with 3
simple lines
Thanks Much
 

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