DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Email in DiaDEM 10

Hello,

I have question about emailing a user in Outlook 2000 or 2003 with a PDF file that was from a report generated in Diadem 10. Has anyone ever seen this done before? I need to add this functionality to my current script I developed.

Greg Newsome

Lab Manager/Test Engineer

Email: gnewsome@britaxusa.com

Greg Newsome
Test Engineer
Labview & DiaDEM products
0 Kudos
Message 1 of 2
(3,296 Views)
Hello Greg!

You can use Outlook via OLE for this task.

Try this code (assuming you have already saved the PDF to the given path):
Option Explicit
 
Dim
oOutlookApp
Dim oOutlookMail
Dim cnByValue : cnByValue =
1
Dim cnMailItem : cnMailItem = 0
 
' Get Outlook Application Object
Set oOutlookApp = CreateObject("Outlook.Application")
 
' Create Mail Item
Set oOutlookMail = oOutlookApp.CreateItem(cnMailItem)
 
' Set Mail Values
With oOutlookMail
.To =
"myname@mydomain.com"
.Subject = "Mail Subject"
.Body = "Mail Body"
 
' Add Attachement
Call .Attachments.Add( "c:\Attachement.pdf", cnByValue, 1 )
 
' Send Mail
Call .Send()
End With

Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 2 of 2
(3,288 Views)