Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Aug 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Recording what a user does in a word doc (word xp vba)

    I create contracts using MS Word and have a macro that allows me to insert a signature.jpg. This process is password protected. I would like to record who uses the macro, when and how many attempts they had (if they did not know the password). I matters not where/how the info is recorded. Any ideas?
    Also, my Normal.dot is getting very large, is there a way to reduce its size please???

    Any help gratefully appreciated... Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Recording what a user does in a word doc (word xp vba)

    Welcome to Woody's Lounge.

    What name would you like to record? The username as specified in the User Information tab of Tools | Options... in Word, or the Windows login name?

    You could store the information in the document itself, or in a text file. It would be helpful if we knew what code you are using (you shouldn't tell us the real password, of course).

    The size of Normal.dot depends on how many styles, AutoText entries, formatted AutoCorrect entries, custom toolbars and macros you have.
    The free Word VBA Code Cleaner add-in may help a bit to reduce the size. See Combatting Template Bloat for a description and to download it.

  3. #3
    New Lounger
    Join Date
    Aug 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Recording what a user does in a word doc (word xp vba)

    Thanks for this

    My code uses the windows login and password ( a function created with vba). The values can be assigned to a variable and I would be happy getting them into a text file. I just can't figure out how to add the values to this file. In an ideal world I would not want the user to know that I was recording what they were up to!

    Thanks

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Recording what a user does in a word doc (word xp vba)

    You could use code like the following:

    Const strFile = "C:Log.txt"
    Dim f As Integer
    f = FreeFile
    Open strFile For Append As #f
    Write #f, strUsername, Now
    Close #f

    This will add a line at the end of the file specified in strFile. The variable strUsername must be filled with the login name.

Posting Permissions

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