Macro Using voltage securemail

K

kd

Hi,

I need to send emails automatically using Voltage SecureMail as my
attachments contains confidential info., so that the email goes Email
encryption. I have created a macro to send emails automatically but need help
to send them using 'Send secure' button. Therefore I need to include a code
in the following macro.

Any help greatly appreciated

Regards,
KD

Sub Send_Email_Attachment()
ESUBJECT = "ABC"
Ebody = "Hi," & (Chr(13)) & (Chr(13)) & " Thanks for any help." & (Chr(13))
& (Chr(13)) & "Regards" & (Chr(13)) & "KD" & (Chr(13)) & (Chr(13))

con = 4

Step100:

NewFileName = Range("b" & con).Value
sendTo = Range("c" & con).Value

If NewFileName = "" Then
GoTo Step1000
Else
Set obOutApp = CreateObject("Outlook.Application")
obOutApp.Session.Logon
Set obOutMail = obOutApp.CreateItem(0)

'Create email with attachments
With obOutMail
.To = sendTo
.CC = ""
.BCC = ""
.Subject = ESUBJECT
.Attachments.Add (NewFileName)
.Body = Ebody
' .Display
.send
End With
con = con + 1
GoTo Step100

End If
Step1000:


End Sub
 
K

Ken Slovak - [MVP - Outlook]

Is the Send Secure button added by that SecureMail software? If so you have
to ask them if the software can be called by a macro. That button is not an
Outlook button so you can't just call it from the Outlook or Office object
models.
 
Joined
Nov 11, 2022
Messages
1
Reaction score
0
Hello, hope this message finds you well.
I know is being a long time since this post was made but, I hope my approach to solve this issue helps someone.

The method I use is sendkeys method.

So what you can do is:

Sub Send_Email_Attachment()
ESUBJECT = "ABC"
Ebody = "Hi," & (Chr(13)) & (Chr(13)) & " Thanks for any help." & (Chr(13))
& (Chr(13)) & "Regards" & (Chr(13)) & "KD" & (Chr(13)) & (Chr(13))

con = 4

Step100:

NewFileName = Range("b" & con).Value
sendTo = Range("c" & con).Value

If NewFileName = "" Then
GoTo Step1000
Else
Set obOutApp = CreateObject("Outlook.Application")
obOutApp.Session.Logon
Set obOutMail = obOutApp.CreateItem(0)

'Create email with attachments
With obOutMail
.To = sendTo
.CC = ""
.BCC = ""
.Subject = ESUBJECT
.Attachments.Add (NewFileName)
.Body = Ebody
.Display
'.send
SendKeys "%H", True '(This opens the "Message" tab)
SendKeys "Y1", True '(This press the "Send Secure" button)
End With
con = con + 1
GoTo Step100

End If
Step1000:


End Sub

Hope this helps
 

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