![]() |
Script to log run and close apps into Mircosoft Office journal
I'm looking for some kind of automated logging into Microsoft Outlook
Journal. I wish that script was started from command line start timer and that apps, than after minut later check what is oppened from main bar. And on closing that apps stop the timer and save new item into Microsoft Outlook Journal. I have found sth like that (at end), but it is not compatibile to new version of autocad, neither it cannot work with all apps, but only Autocad or others that have VBA. After few minutes using autocad it hangs apps, dont know why. But logging and so on is ok. Thanks for any clue. Harpik --- code ##--- Option Explicit Public WithEvents ACADApp As AcadApplication ' Use with Application Event Examples Public myolapp As Object Public myitem As Object Public SALARYMANOPEN As Boolean Public DOCUMENTNAME As String Public REGVAL As Variant Public FN Sub AcadStartup() ' This example intializes the public variable (ACADApp) which will be used ' to intercept AcadApplication Events ' ' The VBA WithEvents statement makes it possible to intercept an generic Object ' with the events associated with that object. ' ' Before you will be able to trigger any of the AcadApplication events, ' you will first need to run this procedure. ' We could get the application from the ThisDocument object, but that would ' require having a drawing open, so we grab it from the system. Set ACADApp = GetObject(, "AutoCAD.Application") FN = GetVariable("DWGNAME") Call ACADApp_EndOpen(FN) End Sub Private Sub ACADApp_BeginQuit(Cancel As Boolean) If DOCUMENTNAME = "" Then End myitem.Subject = DOCUMENTNAME myitem.StopTimer myitem.Save SALARYMANOPEN = False End Sub Private Sub ACADApp_EndOpen(ByVal FileName As String) If SALARYMANOPEN = True Then myitem.Subject = DOCUMENTNAME myitem.StopTimer myitem.Save End If Set myolapp = CreateObject("Outlook.Application") Set myitem = myolapp.CreateItem(4) myitem.Type = "AutoCAD" myitem.StartTimer SALARYMANOPEN = True DOCUMENTNAME = FileName End Sub --- end code ### ---- |
Script to log run and close apps into Mircosoft Office journal
In that sample I don't see why only Applications with VBA should be supported. You could have a list with all ProgIDs that you want to look for, like: - "Excel.Application" - "Word.Application. - "Any.Application" - etc. In Visual Basic, e.g., you could write a standlone EXE with a timer. Once in a minute call all your list items via GetObject. If it returns an error the application runs else it doesn't. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Keep your Outlook categories organized! http://www.shareit.com/product.html?...4&languageid=1 (German: http://www.VBOffice.net/product.html?pub=6) Am 5 Feb 2007 00:42:51 -0800 schrieb Harpik: I'm looking for some kind of automated logging into Microsoft Outlook Journal. I wish that script was started from command line start timer and that apps, than after minut later check what is oppened from main bar. And on closing that apps stop the timer and save new item into Microsoft Outlook Journal. I have found sth like that (at end), but it is not compatibile to new version of autocad, neither it cannot work with all apps, but only Autocad or others that have VBA. After few minutes using autocad it hangs apps, dont know why. But logging and so on is ok. Thanks for any clue. Harpik --- code ##--- Option Explicit Public WithEvents ACADApp As AcadApplication ' Use with Application Event Examples Public myolapp As Object Public myitem As Object Public SALARYMANOPEN As Boolean Public DOCUMENTNAME As String Public REGVAL As Variant Public FN Sub AcadStartup() ' This example intializes the public variable (ACADApp) which will be used ' to intercept AcadApplication Events ' ' The VBA WithEvents statement makes it possible to intercept an generic Object ' with the events associated with that object. ' ' Before you will be able to trigger any of the AcadApplication events, ' you will first need to run this procedure. ' We could get the application from the ThisDocument object, but that would ' require having a drawing open, so we grab it from the system. Set ACADApp = GetObject(, "AutoCAD.Application") FN = GetVariable("DWGNAME") Call ACADApp_EndOpen(FN) End Sub Private Sub ACADApp_BeginQuit(Cancel As Boolean) If DOCUMENTNAME = "" Then End myitem.Subject = DOCUMENTNAME myitem.StopTimer myitem.Save SALARYMANOPEN = False End Sub Private Sub ACADApp_EndOpen(ByVal FileName As String) If SALARYMANOPEN = True Then myitem.Subject = DOCUMENTNAME myitem.StopTimer myitem.Save End If Set myolapp = CreateObject("Outlook.Application") Set myitem = myolapp.CreateItem(4) myitem.Type = "AutoCAD" myitem.StartTimer SALARYMANOPEN = True DOCUMENTNAME = FileName End Sub --- end code ### ---- |
All times are GMT +1. The time now is 05:03 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com