Results 1 to 1 of 1
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Yilgarn region of Toronto, Ontario
    Thanked 0 Times in 0 Posts

    Application integrity (Word2000)

    I was looking for low-key methods to detect end-user interference with appliaction templates.

    If I've thought it out correctly, the attached module provides a limited degree of integrity for a Word VBA application.
    The developer, using the Private macro, saves the application prior to distribution within a ZIP file.
    The end-user unzips the package preserving the FileDateTime stamp on the template.
    The AutoExec checks the FileDateTime stamp against that preserved in the (Word) Document variable.
    As far as I know, the end-user can't see the Document Variable,
    and has no idea why we know that the file has been re-saved, possibly tampered with.
    The MsgBoxes are, of course, suggestions only. Actions may vary.

    <pre>Sub AutoExec()
    If blnChannelOpen(ThisDocument, "Checksum") Then
    Dim strDate As String
    strDate = Format(FileDateTime(ThisDocument.FullName), "YYYYMMDD")
    Dim strDateSaved As String
    strDateSaved = varChannelGetFrom(ThisDocument, "Checksum")
    If strDate = strDateSaved Then
    MsgBox "Checksum OK" ' disable for production
    MsgBox "Mismatched checksum"
    End If
    MsgBox "Could not OPEN Checksum"
    End If
    End Sub
    Private Sub FileSave()
    Dim strDate As String
    strDate = Format(Now(), "YYYYMMDD")
    If blnChannelOpen(ThisDocument, "Checksum") Then
    If blnChannelPutTo(ThisDocument, "Checksum", msoPropertyTypeString, strDate) Then
    MsgBox "Saved with new checksum" ' disable for production
    MsgBox "Could not PUT Checksum"
    End If
    MsgBox "Could not OPEN Checksum"
    End If
    End Sub</pre>

    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts