AW: Helft mir ein VBA-Programm zu schreiben
21.03.2007 08:56:00
Xenia
Public Sub
Dim UserName As String
' --- Assign the value of the action parameter "To" ---
action.To = UserName
' --- Assign the value of the action parameter "Cc" ---
' action.Cc = some value expression
' --- Assign the value of the action parameter "Body" ---
' action.Body = some value expression
' --- Assign the value of the action parameter "Attachments" ---
' action.Attachments = some value expression
' --- Assign the value of the action parameter "From" ---
'action.From = "automation@prinergy.com"
' --- Assign the value of the action parameter "Subject" ---
' action.Subject = some value expression
End Sub
Private Function UserName As String
Dim enc As Text.Encoding
enc = Text.Encoding.Unicode
Dim sr As New IO.StreamReader(" 'Hier ist die Excel-Tabelle zu finden")
Dim line As String
Dim JobName As String
JobName = triggerEvent.RootEvent.Job.Name
Do 'Ab hier happert's bei mir: Die E-mail Adresse wird nicht in das Formularfeld "To" eingefügt
line = sr.ReadLine()
If Microsoft.VisualBasic.InStr(line, JobName) > 0 Then
UserName = JobName
Else
UserName = Microsoft.VisualBasic.Split(line,Microsoft.VisualBasic.vbTab)(2) + _
" " + _
Microsoft.VisualBasic.Split(line,Microsoft.VisualBasic.vbTab)(1) + _
" (" + _
UserName + _
")"
End If
Loop
sr.Close()
Return UserName
End Function