Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way that microsoft word can see that the computer wants to go into sleep mode and SAVE there and then.

e.g. if I or somebody from the welcome screen put the computer into sleep mode(i'd rarely do that but if I did). Or if the battery went low and had to sleep or hibernate, then I want Word to Save immediately before that.

Instead what happens is next time word opens it says it's has recovered files and it shows me autosaved ones which differ from the original. I have an option to save the recovered one, though I want to compare the two files as i'm not sure which is later and the differences. I don't know if I can easily just check the times straight away, but this time when it happened I wanted to compare the two. I chose the option to Save the recovered files, and instead of just saving, a SaveAs dialog box came up, which made me wonder if the autosaved one was older. 'cos if the autosaved one was newer it should've given me the option to just damn well save it. I combined the two files. Which was a hassle. I saved the autosaved one with SaveAs and the default puts the text AutoSave in the filename after. Then I compared the two word documents manually, made them the same, making each have what the other hand, and deleted the autosaved one. There would've been some duplication of text in the document doing that. I miht check the dates next time if it lets me.

Ideal is if Ms Word didn't wet itself when the computer went into sleep mode, if Word could just save the files and not bother me with a list of files it 'recovered'.

Is there any way to get it to do that?

This is Ms Word 2013!!!! So not exactly old software

ADDED

I have continued to get the error. Here is a picture from Win7 and Ms Word 2013. (I think this one I saved again as a new file and merged with the original where necessary).

enter image description here

I do have a network connection when I see this message.

I don't get this problem when the file is local.

share|improve this question
1  
Note, no application will ever be aware of a change in awake state. the system is designed so it doesn't. that said, when you wake it, word should already be opened, and you shouldn't have to recover anything because the file is still open for editing. if there are documents to recover, thats windows way of telling you word exited ungracefully. –  Frank Thomas Jan 3 at 20:31
    
@FrankThomas unfortunately word doesn't seem to exit gracefully when the computer goes into sleep mode. I think if i'm not at the welcome screen and ms word has something open then it might pop something up about a force exit so, not graceful. and it seems to need to exit('cos hence the popup about force exit). i could test again. –  barlop Jan 3 at 20:32
    
This seems like a lot of work (talk) to get around a simple bit of responsibility on the users part. If it's that important, why would you leave a document unsaved to the whims of someone putting the computer to sleep? –  CharlieRB Jan 3 at 20:47
    
It seems to me that instead of doing this, it might make more sense to figure out why Word crashes when your computer goes to sleep. I've never seen Word just completely crash when the computer goes to sleep, so you might be trying to solve one thing when really something else needs fixing. –  nhinkle Jan 12 at 22:54
    
@nhinkle did a further test, added pic. this with win7 word 2013. the problem happens when the document is opened over a network drive, windows file sharing, not when the file is local. It'd be interesting if you can confirm whether or not you get that problem when a file is open over a network drive and windows is put to sleep. –  barlop Oct 16 at 23:31

1 Answer 1

From:

Is there any way to execute something when closing the laptop's lid?

Which references:

a technet answer

1 Input “Task Scheduler” in search box and press Enter

2 Click “Create task…” on the Task Scheduler---Action

3 Go to Triggers, create new triggers

4 On “Begin the task”, select “On an event”

5 Select Log to “system” , set “Source” to “Kernel-Power” , Event ID is “42” and click “Ok”

6 Go to “Actions” and create a new actions

7 You can select “Start a program”, “Send an e-mail” and “Display a message” on action as you need. If you want to mute sound, a script may be needed.

[...]

8 Save the task scheduler

  1. On conditions tab, check the box “Wake the computer to run this task”. Click OK.

Thus, when you close laptop lid, you PC will go to sleep mode, and sleep mode trigger the task scheduler.

You can (in theory) make a macro for word which saves all documents, and have your task call it using vbscript or via a batch file (etc). Probably a good idea to work in a check for whther word is running so as not to launch word to save files that aren't being worked on.

share|improve this answer
    
thanks, this looks a good route –  barlop Jan 3 at 20:43
    
what kind of vbscript would call a macro? what kind of thing did you have in mind for getting vbscript to run a macro in word? –  barlop Jan 6 at 4:16
    
word command line option "/mmacroname" –  horatio Jan 7 at 15:39
    
normally one has one instance of winword.exe and all the documents and if you open new documents it stays with that once instance of winword.exe. The problem is that winword /mMymacro will create a new instance of winword.exe and new document and the macro that runs in that cannot see the other documents(the documents of the other instance of winword.exe). So even a simple macro like to insert text in all my documents, I can't get to work from the command line. –  barlop Jan 7 at 22:18
    
DDE may be an alternative: check for the application and switch to it. Macros are "protected content" sometimes, so you might have to alter the normal template macro permissions. –  horatio Jan 8 at 15:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.