Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-21-2017, 02:27 PM
brent chadwick brent chadwick is offline Auto-saving word docs Windows 8 Auto-saving word docs Office 2013
Advanced Beginner
Auto-saving word docs
 
Join Date: Mar 2015
Posts: 86
brent chadwick is on a distinguished road
Default Auto-saving word docs

Hey Guys,
I found this code on the web some where, and I works well except for two things-
When active in another program such as Firefox, it does not save the Word doc.
When working between multiple Word docs, it only saves the active one.
Suggestions?


Code:
Public Sub FileSave()
ActiveDocument.Save
DoEvents
Application.OnTime _
When:=Now + TimeValue("00:05:00"), _
Name:="FileSave"
Application.StatusBar = "Saved: " & ActiveDocument.Name
End Sub

Reply With Quote
  #2  
Old 02-21-2017, 03:05 PM
dwirony dwirony is offline Auto-saving word docs Windows 7 64bit Auto-saving word docs Office 2003
Advanced Beginner
 
Join Date: Oct 2016
Posts: 49
dwirony will become famous soon enough
Default

Try:

Code:
Public Sub FileSave()
ActiveDocument.ActiveWindow.Visible = True
ActiveDocument.Save
DoEvents
Application.OnTime _
When:=Now + TimeValue("00:05:00"), _
Name:="FileSave"
Application.StatusBar = "Saved: " & ActiveDocument.Name
ActiveDocument.Close
Application.Quit
End Sub
I believe this solution will work to save the one active document. Are you trying to save and close ALL documents on your computer at the specific time? In that case, you'll probably need some sort of loop to go through each document and save them. And that's beyond my knowledge of VBA :S

Last edited by dwirony; 02-21-2017 at 03:08 PM. Reason: Incorrect solution
Reply With Quote
  #3  
Old 02-21-2017, 05:48 PM
brent chadwick brent chadwick is offline Auto-saving word docs Windows 8 Auto-saving word docs Office 2013
Advanced Beginner
Auto-saving word docs
 
Join Date: Mar 2015
Posts: 86
brent chadwick is on a distinguished road
Default

When run this stalls on the second line highlighting "Visible"

Code:
ActiveDocument.ActiveWindow.Visible = True
and gives me the "Method or data member not found."
I am only trying to save all open docs, not close or quit Word-
Reply With Quote
  #4  
Old 02-21-2017, 10:07 PM
gmayor's Avatar
gmayor gmayor is offline Auto-saving word docs Windows 10 Auto-saving word docs Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

See http://www.gmayor.com/automatically_backup.htm which will do as you require (in Excel also).
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #5  
Old 02-22-2017, 05:13 AM
brent chadwick brent chadwick is offline Auto-saving word docs Windows 8 Auto-saving word docs Office 2013
Advanced Beginner
Auto-saving word docs
 
Join Date: Mar 2015
Posts: 86
brent chadwick is on a distinguished road
Default

Slight problem Graham, I'm using this on a Mac-
Reply With Quote
  #6  
Old 02-22-2017, 05:57 AM
gmayor's Avatar
gmayor gmayor is offline Auto-saving word docs Windows 10 Auto-saving word docs Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Your post says Office 2013 on Windows 8?
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #7  
Old 02-22-2017, 02:11 PM
brent chadwick brent chadwick is offline Auto-saving word docs Windows 8 Auto-saving word docs Office 2013
Advanced Beginner
Auto-saving word docs
 
Join Date: Mar 2015
Posts: 86
brent chadwick is on a distinguished road
Default

I also run Mac, this macro I need for the Mac. Forgot to mention it in the first post-my bad-
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto-saving word docs Saving Merged Files into Sep Docs By Name and into PDF accessnewbie352 Mail Merge 15 07-02-2015 09:40 PM
Auto-saving word docs Word auto updating fields and changing numbers when saving to PDF OAEC Word 1 12-03-2013 08:01 PM
Text Shifting When Saving Word 2007 Docs DerekS Word 1 09-21-2013 02:42 AM
Auto-saving word docs Auto Saving in Word, Jamal NUMAN Word 3 01-19-2013 11:50 AM
Icons in the desktop move when saving docs ryochan Word 0 09-26-2009 02:12 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:58 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