Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

how to override save saveAs second time around

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lik - 17 Feb 2005 19:10 GMT
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
Jezebel - 17 Feb 2005 20:40 GMT
You can check if the file has never been saved by comparing its Name and
FullName -- if these are the same the document has never been saved, so use
your manufactured filename; otherwise use the existing name.

Dim pNewName as string

If ActiveDocument.FullName = ActiveDocument.Name then
   pNewName = "TP" & ....
else
   pNewName = ActiveDocument.Name
End if

With Dialogs(..)
   .Name = pNewName
   :

>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
[quoted text clipped - 27 lines]
> Thanks,
> Linda
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.