-2

UPDATE- This problem occurs when the doc/docx file is open over on a network drive/share, with windows file sharing.

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.

barlop
  • 23,380
  • 43
  • 145
  • 225
  • 2
    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 03 '14 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 03 '14 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 03 '14 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 '14 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 '14 at 23:31
  • could any of those that have downvoted this question please explain the reason for the downvote – barlop Oct 14 '16 at 15:53

1 Answers1

2

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.

horatio
  • 3,631
  • 17
  • 15
  • 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 06 '14 at 04:16
  • word command line option "/m*macroname*" – horatio Jan 07 '14 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 07 '14 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 08 '14 at 15:25
  • This link http://www.howtogeek.com/119028/how-to-make-your-pc-wake-from-sleep-automatically/ does it with a time. i.e. the computer goes to sleep then at a particular time, it comes out of sleep. How do you do it without a Time? e.g. sleep triggering the task so it doesn't sleep? – barlop Oct 13 '15 at 05:42
  • 1
    How does this solve the OP's problem? I find that the drives don't immediately mount when the system wakes up, and word can't find the document to save to, in any case. – BenPen Oct 14 '16 at 13:54
  • @BenPen I can't test it at the moment as I no longer have that setup, but I love your diagnosis that the drive is not mounted, I don't know how I missed that.. I guess that if I had done `net use W: .......` then clicked save then word would've seen it, though granted one shouldnt have to do that. I looked up the problem of drive not mounting automatically when waking up from sleep. Does anything here work http://www.tomshardware.co.uk/forum/1567-63-windows-hard-drives-disappear-sleep-resume There is a suggestion to change from AHCI to IDE in the BIOS.. or to install some driver for SATA. – barlop Oct 14 '16 at 16:30
  • maybe other solutions there too.. And maybe it makes a difference how it's mounted.. I think i'd used `net use`.. but I don't know. And if that was the issue then I shouldn't really have framed it as a word issue.. I wonder though if opening it via `\\blahcomp\c$\..`. then perhaps it isn't a problem? Or does that drive totally dismount so no drive letter either? – barlop Oct 14 '16 at 16:31
  • @barlop I will look into this, thanks for the push further in that direction. Q: etc is necessary for a Cmd prompt (blah, I guess I need to go do powershell?) BUT, I agree, it is most likely an issue with those, so for sanity, I might walk away from those... Net locations and ... some other concept do replace them in the explorer, but I've never dug hard enough to figure out if powershell would allow me to stop using those mapped drives... It's always network drives for me, so I don't think I'll have to fuss with AHCI... I'll look into it though. – BenPen Oct 15 '16 at 04:24
  • By the way, I think it's really lame that this question is downvoted so badly. Maybe the question is trying to solve network drive behavior by changing word behavior, but this issue has no resolution documented out there on the Web. – BenPen Oct 15 '16 at 06:23
  • 1
    @barlop also, it must be noted: The instant that Word can't find the file, it reports that it can't find it and you are STUCK. Even if the path re-appears, I believe that word forces you to save your work with save as and then over write the original file with the modified version, in whatever way you like... – BenPen Oct 15 '16 at 06:27
  • @BenPen I had a related issue once, I don't recall the details of it but it may have been that I was in word(don't recall the version), i'd typed a lot and pasted a bunch of pictures and saved, then typed more and and pasted more pictures in, and hadn't saved it for a while yet, then my network cable came loose, and I lost a lot of work, maybe all changes since the last save. So that happened even without going into sleep mode. So that would suggest not just a network drive issue, but a word issue that it doesn't save a copy of the file including unsaved changes locally. – barlop Oct 15 '16 at 11:15
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/46852/discussion-between-barlop-and-benpen). – barlop Oct 15 '16 at 11:16