Prevent saving a blank document over an existing one

U

Udi S

Hello,

In my line of work I've come across more than one customer who mistakingly
saved a blank document over their work, thus losing it.

I'm well aware of backups and the "always create backup copy", but I'm
looking for a macro which will do the following (pseudocode):

if current_document is saved then
check_size
if size<=blank_document_size then // about 25k
give warning / do not allow

is this sort of thing possible?

Any help would be appreciated,
Thanks.
 
K

Kalpesh

Hi,

What about ActiveDocument.Characters.count or
ActiveDocument.Words.count ?

Does this help ?
Kalpesh
 
U

Udi S

Hi,

Thank you - I admit, I do not actually code in VBA. I've
been trying to implement your advice with the DocumentBeforeSave event,
but i'm not quite sure how..

Thanks.
 
K

Kalpesh

Well, you can check if activedocument.characters.count = 0 then, it is
an empty document
Hence, a warning must be raised

Does this help?
Kalpesh
 
U

Udi S

That was clear, the tricky part seems to be getting the event work,
but i'll get by from here :)

Many thanks.
 
Top