Results 1 to 12 of 12
  1. #1
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: EnableEvents???? HELP (Word 2000 and Word 2003)

    Figuring out which event to use for what is a bit complicated. To run code when Word starts up, the traditional shortcut is to use a procedure in a regular code module named AutoExec(). Something like Document_Open generally will "fire" only when you open that document, or a document based on that document. If you want to run something when Document1 is created, you could try Document_New and see if that fires.

  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: EnableEvents???? HELP (Word 2000 and Word 2003)

    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15> Jefferson

    What I am trying to do is make a Usage macro.

    I am learning how to type in languages other than Latin, and thus the keyboards are not QWERTY style. Its hard[scary]. The characters are mixed with the Latin alphabets, and its hard to look at the keyboard with all these "things" on the keys.

    So I want to test my speed, I typically want the macro to:

    1) Tag a text file with something like: "Started at Time and date"
    2) Saved at Time and date
    3) Number of characters typed, well I can get this via some sort of counting.
    4) When I close Word, to also tag a text file with "Ended at Time and date".

    I though this code should be in the Normal.Dot vs a document on its own, I will not be working with the same document always.

    So what are your thoughts?

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  3. #3
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: EnableEvents???? HELP (Word 2000 and Word 2003)

    You may be able to achieve what you want much more simply by including an { EditTime } field, or just look at File > Properties > Statistics > Total Editing Time

    StuartR

  4. #4
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: EnableEvents???? HELP (Word 2000 and Word 2003)

    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15> Stuart

    This is exactly where I got the idea(s) from. But this is cumulative. Is there a way to say that on Saturday you worked for 10 minutes, and then on Monday you worked for 2 hours, and Tuesday 7 hours, and so on?

    This is why I wanted to send this data to a text file, so that I can see how I am doing.

    Oh BTW about 6 members of my dept. will use this macro as well, so they also may want to check their work, and Big Boss will also want to see who is doing what.

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  5. #5
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: EnableEvents???? HELP (Word 2000 and Word 2003)

    How about turning on the Outlook journalling facility? You do this in Outlook from Tools > Options > Preferences > Journal Options...

    StuartR
    Attached Images Attached Images
    • File Type: gif x.GIF (13.3 KB, 0 views)

  6. #6
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Macro to log start/end times/keystrokes (2003)

    <P ID="edit" class=small>(Edited by jscher2000 on 14-Feb-04 15:13. More descriptive subject line assigned to this new thread.)</P> <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Stuart

    Are events in MS-Word 2003 disabled by default?

    I tried to write some code to execute when I open the MS-Word application, so I thought that I would put the code in the Document_Open of the Normal.DOT template, but <img src=/S/crybaby.gif border=0 alt=crybaby width=15 height=15> it does not seem to work?

    Is that the right place to put the code?

    Thanks a million <img src=/S/money.gif border=0 alt=money width=17 height=15>

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: EnableEvents???? HELP (Word 2000 and Word 2003)

    In theory, Document_Open might work, but the old reliable approach is to create an AutoOpen() macro.

    I'm not clear on where you want these annotations inserted. If I open a file to do a bit of work, would the annotation of start time go at the top or bottom? What if there's already one in there? Do you want it to be visible or inserted as a comment (usually not printed)?

    Let's assume you want to just dump information at the end. You could use an AutoOpen macro like this:
    <UL>Sub AutoOpen()
    ActiveDocument.Content.InsertAfter vbCrLf & "Opened: " & Format(Now, "dd MMMM yyyy at hh:nn:ss")
    End Sub[/list]Then at close, an AutoClose macro could insert the corresponding closed time:
    <UL>Sub AutoClose()
    ActiveDocument.Content.InsertAfter vbCrLf & "Closed: " & Format(Now, "dd MMMM yyyy at hh:nn:ss")
    End Sub[/list]As for Save, there is no AutoSave macro, so you'd have to replace the FileSave command and maybe the FileSaveAs command, remembering to actually save the document!
    <UL>Sub FileSave()
    ActiveDocument.Content.InsertAfter vbCrLf & "Saved: " & Format(Now, "dd MMMM yyyy at hh:nn:ss")
    ActiveDocument.Save
    End Sub[/list]Does that get you started?

  8. #8
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: EnableEvents???? HELP (Word 2000 and Word 2003)

    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15> Stuart

    OK I have to now go and get a MS-Office 2003 book.

    Why would this be in Outlook vs in all office applications?

    Darn, some things are so hidden it just does not make sense.

    I'll try this and report back, but I still would like a macro.

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  9. #9
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: EnableEvents???? HELP (Word 2000 and Word 2003)

    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15> Jefferson

    You got part of what I am looking for quite good, and there is another Thank You for making this into a thread onto its own. I thought of it, but then when I went searching I found the old thread, and ran with it.

    To answer your question(s):

    <<< In theory, Document_Open might work, but the old reliable approach is to create an AutoOpen() macro. >>>

    I am going to do that right away.

    <<< I'm not clear on where you want these annotations inserted. >>>

    I a text file via something like: Open sPathToLogFiles & "Usage Log.txt" For Append As #1

    <<< If I open a file to do a bit of work, would the annotation of start time go at the top or bottom? >>>

    It really does not matter, I guess once you see the above, you will know why, but I can always sort the Log.TXT file and see what entries I need and what I can trash.

    <<< What if there's already one in there? Do you want it to be visible or inserted as a comment (usually not printed)? >>>

    Its going to be in an external text file, so none of that will be applicable, and also if I use the same file twice, well it will need to show that with two entries.

    The macros you have maybe the starting point. AutoOpen() was always the best.

    Thanks again

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  10. #10
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: EnableEvents???? HELP (Word 2000 and Word 2003)

    Hi Wassim,

    If you used different documents for each session, and only need accuacy down to the minute, then the SAVEDATE and CREATEDATE fields could be used. Basically, you'd subtract the CREATEDATE date & time from the SAVEDATE date & time.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  11. #11
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: EnableEvents???? HELP (Word 2000 and Word 2003)

    Macropod,

    Wouldn't SAVEDATE - CREATEDATE just give you EDITTIME?

    StuartR

  12. #12
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: EnableEvents???? HELP (Word 2000 and Word 2003)

    Yes, of course <img src=/S/bingo.gif border=0 alt=bingo width=15 height=22> - and has the advantage of catering for multiple sessions.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

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