Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Name Stamp Office Files

Status
Not open for further replies.

spaulding

Technical User
Jan 10, 2001
123
US
I work in a school district and have been asked to find a way to identify the creator of office files in a way that can't be modified. (Kids have been copying a finished document and submitting it as their own) I know how to get the logged in userID and put it into say the footer, but is there a way to make the footer uneditable? Or if I put it into the Author/Creator field, can I make the document properties uneditable? I'd appreciate any help or other ideas.
Thanks
 




Hi,

Cheaters will always find a way. The stupid ones will rename a file. Those a little smarter will copy and paste. The clever ones take the copy and paste one step further and modify a bit.

"Kids have been copying a finished document..."

Are these coming off the internet? Do a Google search on a significant phrase out of any submission. See what you get.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
What about the situation when they create a document and copy the contents only? As long as it is possible to edit the document, you will never know the way it was completed.

combo
 
Thanks for the response. No, they're part of a Business Communications class that teaches Office. They're basically documents produced through exercises from the textbook or the teacher. So, they're going to be remarkably similar when completed. I've written a fair amount of code, but not a lot of Office type macros, so I don't know if it's possible to lock a feature after it's initially written. Basically, what I had in mind was a macro that executes on creation, finds the logged in username, writes that to the Author property, then renders that property read-only. Is that doable?

BTW, I agree with your assessment completely, but I'm looking for something difficult enough to bypass that if a student can figure it out, they're WAYYYYYYY beyond needing instruction in basic Office techniques.
 




Use the FORMS toolbar and LOCK the document.

You could get fancy and use a macro in ThisDocument (locked with a password) that checks the filename and if it is different, in the OPEN event, unlock the doucment and DELETE everything and save or just Close. Of course that could be defeated by not enabling macros, so the macro that runs when you CLOSE the doc, ought to do something like set the font to WHITE, which makes the document appear to be empty.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 



Here's an example of a pretty simple "security" lock that renders the document useless if it's saved as some other name. Copy the code to the ThisDocument module and modify as required...
Code:
Private Sub Document_Close()
    Dim rng As Range
    Set rng = ThisDocument.Range
    rng.WholeStory
    rng.Font.Color = vbWhite
    ThisDocument.Protect wdAllowOnlyReading
    Set rng = Nothing
    ThisDocument.Save
End Sub
Private Sub Document_Open()
    Dim rng As Range, sDoc As String
    sDoc = "D:\My Documents\Security Test.doc"
    
    With ThisDocument
        If .Path & "\" & .Name = sDoc Then
            ThisDocument.Unprotect
            Set rng = ThisDocument.Range
            rng.WholeStory
            rng.Font.Color = vbBlack
            Set rng = Nothing
        End If
    End With
End Sub

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top