how can i get the current user which starts the store eventsink???
- From: info@xxxxxxxxxxxxxxxx (Florian Endres)
- Date: 31 Mar 2005 04:56:50 -0800
Hello,
i have built a script with the EventSink Wizard from the Exchange SDK
Tools.
Now i wanna add the user ,which start the store eventsink, too the
logfile generated by the script. In the code snippet below i added my
coding with * at the begin of the line.
This script below doesn't work with my code but it works without it.
#############################
Sub EventLog(EventName As String, ByVal bstrURLItem As String,
Optional ByVal lFlags As Long = 0, Optional bstrComment As String =
"")
*Dim user As String
*Dim objSession As MAPI.Session
*Set objSession = CreateObject("MAPI.Session")
*objSession.Logon
*user = objSession.CurrentUser
'This function writes to the log file details of an event being
executed. It is called from each event procedure.
If Not PERFORM_FILE_LOGGING Then 'Check if logging is turned off
Exit Sub ' If so, do not perform logging
End If
Dim FSO As Scripting.FileSystemObject
Dim WinTmpFile As String
Dim OnSaveFile As Scripting.TextStream
Set FSO = New Scripting.FileSystemObject
'Instantiate the FileSystemObject
WinTmpFile = FSO.GetSpecialFolder(SystemFolder).Path & "\" &
LogFile 'Set the path of the log file to be in the Windows System
Folder
Set OnSaveFile = FSO.OpenTextFile(WinTmpFile, 8, True)
'Open the file for Appending
OnSaveFile.WriteLine Format(Now, DATE_TIME_FORMAT)
'Write the current date and time
OnSaveFile.WriteLine (" Event Name:" & EventName)
'Write the Event Name
OnSaveFile.WriteLine (" URL of Source Item:" & vbTab &
bstrURLItem) 'Write the URL of the Event source
OnSaveFile.WriteLine (ReturnEXOLEDBFlags(lFlags))
'Write the flags that are currently set
OnSaveFile.WriteLine (" COMMENT:" & vbTab & bstrComment)
'Write the comment, if any
* OnSaveFile.WriteLine (" User:" & user)
'Write the comment, if any
OnSaveFile.WriteLine (String(80, "-"))
'Write a separator line to the file
OnSaveFile.WriteBlankLines (1)
'Insert a blank line into the file
OnSaveFile.Close
'Close the log file
Set FSO = Nothing
End Sub
#####################
can anyone help me.
thanx
florian
.
- Follow-Ups:
- Re: how can i get the current user which starts the store eventsink???
- From: Victor Ivanidze
- Re: how can i get the current user which starts the store eventsink???
- Prev by Date: Re: Rebuild OAB using code?
- Next by Date: Mail enable recipients in Active Directory using ldap
- Previous by thread: Rebuild OAB using code?
- Next by thread: Re: how can i get the current user which starts the store eventsink???
- Index(es):
Relevant Pages
|