View Single Post
 
Old 08-19-2014, 06:15 AM
Byron Polk Byron Polk is offline Windows 7 64bit Office 2010 32bit
Novice
 
Join Date: Jul 2014
Location: Whitehouse, TX
Posts: 14
Byron Polk is on a distinguished road
Default

Greg,

I just wanted to get back with you and let you know how much I really appreciate you assistance.

I was able to use some of your code to accomplish exactly what I wanted to do.

Just FYI, my goal was to be able to protect the use of a very custom template that I have been developing for a client. This client wanted to be able to allow multiple users to use this template but not to allow any user to be able to share or give the template away to anyone else.

The process works like this; a unique (incrementing) serial number is assigned to each copy of the template and a random number is then generated that is also assigned to the template. These two unique values are written to custom document properties in the template and also written to a table in a hosted SQL database in the cloud.

Each time the user opens or uses the template, code in the templated immediately checks to see if the serial number stored in the custom document property can be found. If the matching serial number cannot be found the user is informed that the current copy of the template cannot be verified as a valid registered copy of the template and will be closed. The template closes without creating a new document.

If the serial number is found to be valid, the code then checks to see if the unique random number stored in the custom document property is equal to the random number saved to the cloud database record. Again, if the random numbers are found and match, all is just fine, but if the random numberes do not match, the user is informed and the template will not create the new document. Because the unigue random number is created and updated in the template and the database each time the template is used the sharing of the template is prevented because the two random numbers will not match.

If the template is found to be registered, not shared and actually creates the new document the code immediately creates a new random number for that copy of the template, updates the custom document property in the template file and updates the field in the SQL database in the cloud with the same random number so the entire process can be performed again the next time the template is used.

If a registered user shares their copy of the template and the individual they gave it to uses it before the registered user uses it again, the registered user's copy will not longer work when they try to use it because the rendom numbers do not work. The copy they gave away will continue to work. But this process will at least cause only one copy to be a working copy. By working with the registered user we can reactivate their copy to be the registered copy and at that point the copy they gave away will no longer work. We can also let them know that they are not allowed to give a copy to anyone else.

Just thought I would share what I have done to protect the use of the template.

Thanks again for your assistance.

Byron
Reply With Quote