Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-23-2015, 09:04 PM
Raven917 Raven917 is offline Saving a doc in two places, Word 2000/2003 Windows XP Saving a doc in two places, Word 2000/2003 Office 2003
Novice
Saving a doc in two places, Word 2000/2003
 
Join Date: Nov 2015
Location: Berkeley, CA
Posts: 2
Raven917 is on a distinguished road
Default Saving a doc in two places, Word 2000/2003

I was looking for a way for a friend to back up a document automatically to her Dropbox account and found this handy replacement Save method from Allen Wyatt's Word tips, which saves a named doc to a backup folder as well as to the default location:

Code:
Sub FileSave()
    Dim docName As Boolean
    Dim templateFullName As String

    docName = ActiveDocument.name Like "Document#*"
    templateFullName = ActiveDocument.FullName
    If docName = True Then
        Dialogs(wdDialogFileSaveAs).Show
    Else
        ActiveDocument.SaveAs FileName:="C:\Backups\" _
          & ActiveDocument.name, AddToRecentFiles:=False
        ActiveDocument.SaveAs FileName:=templateFullName
    End If
End Sub
It was easy to adapt to save to the Dropbox folder as well as to the default location. My question is this: It doesn't cover the situation where you close Word and are prompted "Do you want to save the changes to filename.doc? (Yes/No)" Does anyone have the name and content of that method, which I might try adapting to save in two places?
Reply With Quote
  #2  
Old 11-24-2015, 05:29 AM
gmaxey gmaxey is offline Saving a doc in two places, Word 2000/2003 Windows 7 32bit Saving a doc in two places, Word 2000/2003 Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

You are going to need to create a template addin containing an event handler.

'Put this code in a standard code module:
Public AppEvents As New clsEvents
Public Sub AutoExec()
Set AppEvents.WordApp = Word.Application
End Sub
'Put this code in a class module named clsEvents:
Public WithEvents WordApp As Word.Application
Private Sub WordApp_DocumentOpen(ByVal strDocName As Word.Document)
MsgBox strDocName & " is opening"
End Sub
Private Sub WordApp_DocumentBeforeClose(ByVal strDocName As Word.Document, ByRef Cancel As Boolean)
MsgBox strDocName & " is closing"
End Sub
Private Sub WordApp_Quit()
MsgBox "WordApp_Quit"
End Sub

You can probably put your code in the DocumentBeforeClose event.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 11-24-2015, 01:42 PM
Raven917 Raven917 is offline Saving a doc in two places, Word 2000/2003 Windows XP Saving a doc in two places, Word 2000/2003 Office 2003
Novice
Saving a doc in two places, Word 2000/2003
 
Join Date: Nov 2015
Location: Berkeley, CA
Posts: 2
Raven917 is on a distinguished road
Default

Greg, thanks. I'll give this a go.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving a doc in two places, Word 2000/2003 Word 2000 to Word 2003 or higher oao Word 5 07-27-2015 11:55 PM
word 2003 slow saving passworded files windows 7 dontdoslow Word 5 08-08-2014 04:12 AM
Saving a doc in two places, Word 2000/2003 Problems saving with Word 2003 Gillian0511 Word 4 07-31-2014 03:29 AM
Excel 2003 / 2007 files saving slow on Win 2003 Server Atradius Office 0 07-23-2011 07:41 AM
Can you embed a project 2000 doc into a Word 2003 doc? jackdeth Office 0 11-14-2006 01:02 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft