Discussion:
question on file save or save as
(too old to reply)
lik
2005-02-17 18:00:10 UTC
Permalink
i have a macro set to auto fill in the file name when a user clicks save or
save/as. Right now multiple open and save/saveas of the documents will
always use my prefilled info I have defined in the macro. If a user
overrides my default and saves the document. The next time they open the
doucment and click on save or save-as, how do I code to use what they named
it rather than my default. Im probably not making myself clear, so here is
an example;

My code for save is
Sub FileSave()
With Dialogs(wddialogfilesaveas)
.Name = "TP" & ActiveDocument.FormFields("rfacurrent").Result
.Show

End With

End Sub

User sees the auto fill in of TP123456.doc as the file name. They change
it to be saved as
TP123456automaticcomm.doc. It saves the document as
TP123456automaticcomm.doc. BUT the next time they open the document to make
changes, and save it, it changes back to TP23456.doc, and they ahve to
retype the tp123456automaticcomm.docr . How can I tell it to save as
TP123456automaticcommdoc the second + times they save the document?

Thanks,
Linda
Word Heretic
2005-02-21 07:42:07 UTC
Permalink
G'day "lik" <***@yahoo.com>,

Store a document variable indicating whether to the document was saved
as something else, either use the default calculated path or the
current location based on this variable.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice
Post by lik
i have a macro set to auto fill in the file name when a user clicks save or
save/as. Right now multiple open and save/saveas of the documents will
always use my prefilled info I have defined in the macro. If a user
overrides my default and saves the document. The next time they open the
doucment and click on save or save-as, how do I code to use what they named
it rather than my default. Im probably not making myself clear, so here is
an example;
My code for save is
Sub FileSave()
With Dialogs(wddialogfilesaveas)
.Name = "TP" & ActiveDocument.FormFields("rfacurrent").Result
.Show
End With
End Sub
User sees the auto fill in of TP123456.doc as the file name. They change
it to be saved as
TP123456automaticcomm.doc. It saves the document as
TP123456automaticcomm.doc. BUT the next time they open the document to make
changes, and save it, it changes back to TP23456.doc, and they ahve to
retype the tp123456automaticcomm.docr . How can I tell it to save as
TP123456automaticcommdoc the second + times they save the document?
Thanks,
Linda
aks
2005-02-23 19:39:40 UTC
Permalink
If I understand what you are trying to do it looks like we are working
on very similar tasks. We have devised a VBA that interjects itself
during Save and SaveAs as a special userform. Its purpose is to make
sure the document is named correctly and saved at the correct location
so that project documents follow office proceedures. It does all the
naming work based upon the type of document, including creating any
missing folder structures beyond the project folder level. The
problem you describe is one we currently handle with a button on the
form named "Save O'School" that brings up the traditional Save As
dialog. The document variable solution for existing documents would
not work for us because existing project documents are often used as
seed files for new documents. Therefore in our scheme all existing
documents appearing to be project related can be saved to a new
automatic name. We plan to add another button that simply saves to the
original name to eliminate the addtional mouse press required to
handle existing document edit situations when using the Save O'School
button.

Allan
Post by lik
i have a macro set to auto fill in the file name when a user clicks save or
save/as. Right now multiple open and save/saveas of the documents will
always use my prefilled info I have defined in the macro. If a user
overrides my default and saves the document. The next time they open the
doucment and click on save or save-as, how do I code to use what they named
it rather than my default. Im probably not making myself clear, so here is
an example;
My code for save is
Sub FileSave()
With Dialogs(wddialogfilesaveas)
.Name = "TP" & ActiveDocument.FormFields("rfacurrent").Result
.Show
End With
End Sub
User sees the auto fill in of TP123456.doc as the file name. They change
it to be saved as
TP123456automaticcomm.doc. It saves the document as
TP123456automaticcomm.doc. BUT the next time they open the document to make
changes, and save it, it changes back to TP23456.doc, and they ahve to
retype the tp123456automaticcomm.docr . How can I tell it to save as
TP123456automaticcommdoc the second + times they save the document?
Thanks,
Linda
Loading...