?
Solved

MS Word background save in VBA

Posted on 2013-06-16
6
Medium Priority
?
744 Views
Last Modified: 2013-06-22
Is there a way to execute a background save in MS Word 2003 via VBA?
ActiveDocument.Save  and ActiveDocument.SaveAs will save the document but the user has to wait until the save is complete unlike clicking on the save icon which allows the user to edit the document while the save executes (background save is turned on). In fact, VBA execution pauses while the save completes. Even code before the ActiveDocument.Save command pauses execution while the save completes. Is there a way to avoid this?
0
Comment
Question by:thenelson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 15

Expert Comment

by:Berkson Wein
ID: 39253399
The problem is that the Save process executes in the same thread.  I >>believe<< that the SaveAs (Or SaveAs2) is asynchronous so that should return immediately.  Are you sure that SaveAs doesn't work either?
0
 
LVL 49

Accepted Solution

by:
PortletPaul earned 2000 total points
ID: 39254973
Save and SaveAs both work in the foreground, and SaveAs would also require making a copy (plus a target name and location)

Personally I don't believe you can invoke the 'background save' via VBA - I did some hunting yesterday and found nothing to suggest you can access the inbuilt background save.
Maybe it exists (perhaps by some undocumented hook?) but could not find it.
0
 
LVL 39

Author Comment

by:thenelson
ID: 39255027
For some reason my response to weinberk did not get saved.

Save and SaveAs both change the mouse cursor to an hourglass for a few seconds and editing is paused during that time. SaveAs2 allows editing almost immediately but the file modified time does not change and when I close the document immediately after running SaveAs Word asks if I want to save the document so I don't think it is doing anything.

I did discover a solution to the problem "Even code before the ActiveDocument.Save command pauses execution while the save completes." by placing a DoEvents just before the Save command.

PortletPaul,
Yes, I too spent some time searching for a solution before posting the question. I am hoping someone knows about some undocumented something.
0
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 
LVL 49

Expert Comment

by:PortletPaul
ID: 39255040
:) given it's Word 2003 that's plenty of time for undocumented stuff to emerge.
Whilst I do not claim vast knowledge in this area, nor that my searches were exhaustive, I wouldn't be betting on finding this elusive feature. (but then I don't bet much anyway.)

good luck - I'll watch on to see if some gold nugget does arrive. Cheers, Paul
0
 
LVL 39

Author Comment

by:thenelson
ID: 39266896
I've requested that this question be deleted for the following reason:

There was no answer
0
 
LVL 15

Expert Comment

by:Berkson Wein
ID: 39266897
There was an answer, and I don't think this should be closed.  PortletPaul wrote: "Personally I don't believe you can invoke the 'background save' via VBA"
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question