If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
on close save as x
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 |
#2
|
|||
|
|||
on close save as x
See the article "How to save a document using a filename that gets
incremented by 1 each time if the filename already exists" at: http://www.word.mvps.org/FAQs/Macros...edFilename.htm -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Curt" wrote in message ... 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 |
#3
|
|||
|
|||
on close save as x
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 "Doug Robbins - Word MVP" wrote: See the article "How to save a document using a filename that gets incremented by 1 each time if the filename already exists" at: http://www.word.mvps.org/FAQs/Macros...edFilename.htm -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Curt" wrote in message ... 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 |
#4
|
|||
|
|||
on close save as x
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 "Doug Robbins - Word MVP" wrote: See the article "How to save a document using a filename that gets incremented by 1 each time if the filename already exists" at: http://www.word.mvps.org/FAQs/Macros...edFilename.htm -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Curt" wrote in message ... 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 |
#5
|
|||
|
|||
on close save as x
See the article "A Pseudo DocumentBeforeClose Event" at:
http://www.word.mvps.org/FAQs/Macros...eforeClose.htm -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Curt" wrote in message ... 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 "Doug Robbins - Word MVP" wrote: See the article "How to save a document using a filename that gets incremented by 1 each time if the filename already exists" at: http://www.word.mvps.org/FAQs/Macros...edFilename.htm -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Curt" wrote in message ... 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 |
#6
|
|||
|
|||
on close save as x
Thanks will see what I can do
"Doug Robbins - Word MVP" wrote: See the article "A Pseudo DocumentBeforeClose Event" at: http://www.word.mvps.org/FAQs/Macros...eforeClose.htm -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Curt" wrote in message ... 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 "Doug Robbins - Word MVP" wrote: See the article "How to save a document using a filename that gets incremented by 1 each time if the filename already exists" at: http://www.word.mvps.org/FAQs/Macros...edFilename.htm -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Curt" wrote in message ... 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 |
#7
|
|||
|
|||
on close save as x
With the two sites you sent I was able then to solve the problem with 3
simple lines Thanks Much "Doug Robbins - Word MVP" wrote: See the article "A Pseudo DocumentBeforeClose Event" at: http://www.word.mvps.org/FAQs/Macros...eforeClose.htm -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Curt" wrote in message ... 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 "Doug Robbins - Word MVP" wrote: See the article "How to save a document using a filename that gets incremented by 1 each time if the filename already exists" at: http://www.word.mvps.org/FAQs/Macros...edFilename.htm -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Curt" wrote in message ... 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 |
Thread Tools | |
Display Modes | |
|
|