PDA

View Full Version : Advice: Save vs BackgroundSave



XL-Dennis
05-25-2004, 06:53 AM
Hi All :hi

Are there any advantage (speed / performance) to use BackgroundSave instead of the Save-command?

Kind regards,
Dennis

fumei
05-25-2004, 11:01 AM
No. In fact using background save uses up more resources. If you want to conserve system resources, you may want to turn it off.

Also, hopefully you also turn OFF fast saves under the Save tab. Not sure if it is relevant for you, but even if you have fast save enabled, if the file is on a network drive, it is ignored. Fast save ONLY works on local drives.

XL-Dennis
05-25-2004, 12:38 PM
Hi Gerry,

Thanks for the information and what I conclude is that the following example is the best one to go with:


Option Explicit
Sub test()
Dim wdDoc As Document
Dim bStatus As Boolean
Set wdDoc = ActiveDocument
With Options
bStatus = .BackgroundSave
.BackgroundSave = False
wdDoc.Save
.BackgroundSave = bStatus
End With
End Sub


Kind regards,
Dennis

fumei
06-15-2004, 09:49 PM
Well yes, but strictly speaking, the code is applying content to different objects.

Options.anything is a property of the Application object, not the Document object.

So unless you are doing something more involved, it is not needed to declare wdDoc as ActiveDocument. The With.Options is not doing anything at all to the wdDoc object. You should also Set wdDoc = Nothing at the end.

That being said, it certainly is good practice to record the state of properties, and return them once you are done. In this case though, if backgroundsave = true, you will be returning the application back to backgroundsave. My point was that backgroundsave, if resources are critical, should be off, and stay off.