Add attachment with vbscript in Outlook form

R

rob

I wont to add automatically when I open a Outlook form (
user-defined form not a UserForm) a log file like
params.log
or with click to a button but this code doesn't work.

I inserted this code in the Outlook script editor.

Function Item_Open()
Msgbox "Alle [ GELB ] gekennzeichnete Felder sind
zwingend. Bitte, alle ausfüllen." (This line of code works
fine)
Dim iMsg
Set iMsg = CreateObject("CDO.Message")
With iMsg
.AddAttachment "\\biscussrv01\appl\log\params.log"
.Subject = "Supportanfrage"
.TextBody = "Details sind dem angehängtem Log zu
entnehmen."
End With
End Function

Sub AddLog_Click()
Dim iMsg
Set iMsg = CreateObject("CDO.Message")
' configure message here if neccessary
With iMsg
.AddAttachment "\\biscussrv01\appl\log\jboss.log"
.Subject = "Supportanfrage"
.TextBody = "Details sind dem angehängtem Log zu
entnehmen."
End With
End Sub


Any help would be greatly appreciated. Thanks.
Roberto Crivelletto
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top