none
Close Document after inactivity - vb(a) RRS feed

  • Question

  • Hi All,

    I can find several items on closing Excel after a certain time of inactivity, but nothing on MS Word (2010 or 2013). I can use most of the tricks from Excel in Word VBA with a little help from MSDN, but can someone help me with the piece that actually measures or defines inactivity, like not pressing any keys or not moving the mouse for a certain time, or maybe also a trigger when the computer autolocks for security reasons.

    The reason for this is that a friend of mine asked for a document that autocloses after 15 minutes of inactivity. They do not want to use the possibility of a shared document. They are all older ladies doing charity and they keep forgetting to close the document so that others can use it.

    Thanks in advance for your help.

    PS. I do have full access to Visual Studio 2013, just started education enabling that. Just not so familiar with it yet. But if I have to move my solution to Studio and out of office VBA, I'm eager to learn how.

    Thanks, Hendrik

    Monday, January 19, 2015 10:37 PM

Answers

  • Hi Hendrik,

    >>but can someone help me with the piece that actually measures or defines inactivity, like not pressing any keys<<
    I am not able to find the exact definition for inactivity. Based on my understanding, the application doesn't recieve the input(keyboard, mouse click etc.)

    >>The reason for this is that a friend of mine asked for a document that autocloses after 15 minutes of inactivity. <<

    As far as I know, there is no such methoed in Excel Object model we can get the time of inactivity. I suggest that you submit the feedback from link below, if you want Office to support this feature:
    Submit Feedback - Microsoft Office

    >>They are all older ladies doing charity and they keep forgetting to close the document so that others can use it.<<
    I suggest that use auto-locking for the computer to protect unauthorized users using the computer.

    Hope it is helpful.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 21, 2015 5:31 AM
    Moderator