Click to See Complete Forum and Search --> : Word Document Security
Kid_Coke
Apr 27th, 2005, 08:37 AM
Try this one on for size,
My boss has asked me if there is a way that he can create a word document that can only be viewed x number of time and then automatically delete itself, or have the file "disappear" after x days.
Has anyone else attempted this or seen anything like this?
Thanks.
Kid Coke
DaveBo
Apr 27th, 2005, 09:15 AM
I think you could do that, but it wouldn't be foolproof, e.g. the user can disable macros or just hold the shift key while opening the doc. and I believe your startup VBA would be skipped.
Word VBA lets you save a variable with the document.
Checkout ActiveDocument.Variables(index)
So you could keep a counter or drop-dead date in there to check against. I've haven't tried it.
Deleting a doc while it's open may not work, but you could delete its contents and do an immediate save.
RobDog888
Apr 27th, 2005, 10:35 AM
About all you could do is if the x number of openings are reached, then close the doc without saving the changes.
ActiveDocument.Close FalseI think the way MS does it with its beta versions is by making a registry entry and disables
the toolbars when the time is reached. No, you cant delete the document from WOM VBA.
Kid_Coke
Apr 27th, 2005, 12:21 PM
Thanks people!
I figured that using a macro to delete the document contents on x date followed by a save is the only way to pull this off.
Do you think there are otherways to make "self destructive" files (excel, acrobat, etc)
Let me know what you guys think.
RobDog888
Apr 27th, 2005, 12:37 PM
Any way you try it, the file will need to be closed. You cant delete it from Word VBA.
Why go to all this trouble to delete it? If you prevent them from opening it after x number of times that should make them
want to delete it on their own.
Kid_Coke
Apr 27th, 2005, 02:37 PM
Rob .... I guess I didn't read your post carefully.
If the person were to copy the document with a new name and they open it will the limitations still exist?
Personally, I don't understand why my boss is going to all this trouble to protect this document but it seems important to him.
Thanks.
Br1an_g
Apr 27th, 2005, 03:36 PM
you could create a DOS batch file.
e.g. word doc opens, VBA calls DOS batch file, which closes word, and deletes the file.
this will work even if they copy the file to another location as the DOS batch will always be in the same location with the same name and it is this that will do the deletion.
still doesnt help if the user disables VBA.
just a thought
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.