I Am Not That Good With VB.
Code: Select all
VBStart
Function CreateEmail(strRecipient, strSubject, strBody)
'Create OL App object
Set objOLApp = CreateObject("Outlook.Application")
If objOLApp is nothing then
MsgBox "Could not create OL App. Shutting Down"
Exit Function
End If
'Create a new mail item
Set objMsg = objOLApp.CreateItem(0)
If objMsg is nothing then
MsgBox "Could not create Mail Item. Shutting Down"
Exit Function
End If
'Set basic message parameters
objMsg.To = strRecipient
objMsg.Subject = strSubject
objMsg.Body = strBody
'Send the message
objMsg.Send
'Free up the space
Set objOLApp = Nothing
Set objMsg = Nothing
CreateEmail = "Success"
End Function
VBEnd
Dialog>InfraMissing
Caption=Asset Missing From Infra
Width=399
Height=261
Top=104
Left=16
Max=0
Min=0
Close=1
Resize=0
Label=Please enter the details of the missing asset from Infra,8,8,true
Label=Asset Number,16,32,true
Edit=AssetNumber,16,48,249,
Label=Linked Asset (Example COM1234),16,80,true
Edit=LinkedAsset,16,96,249,
Label=Infra Call,16,128,true
Edit=InfraCall,16,144,249,
Label=Customer Name,16,176,true
Edit=CustomerName,16,192,249,
Button=Email%CRLF%Infra%CRLF%Admin,280,48,105,73,3
Button=Cancel,280,144,105,73,2
EndDialog>InfraMissing
Show>InfraMissing,r
If>%r%=2,Exit
If>%r%=1,Mail
Label>Mail
Let>[email protected]
Let>strSubj=Asset missing from Infra Database
Let>strBody=Asset Number: %InfraMissing.AssetNumber%%CRLF%Linked Asset: %InfraMissing.LinkedAsset%%CRLF%Infra Call: %InfraMissing.InfraCall%%CRLF%Customer Name: %InfraMissing.CustomerName%
VBEval>CreateEmail("%strTo%","%strSubj%","%strBody%"),Answer
Label>Exit