Good afternoon. I have inherited the following code in VB6 for send e-mails.
Is it possible to use something like
in order to get past the “A program is trying to automatically send email on your behalf” window that pops up & stops you in your tracks? Probably not. I am using Outlook 2003 running through Exchange on my firm’s network so I don’t want to think about changing global security settings.
Is there any other way without resorting to 3rd party software?
I’ve had a look at thread329-664947 and extracted the following code
but it just seems to jump to the next bit of code from where this was called in the VB6 project and not do anything. Grrrr.
Am I close? Am I nuts?
Many thanks,
Des.
Code:
Public Sub email()
Dim oOApp
Dim olMailItem
Dim oOMail
Set oOApp = CreateObject("Outlook.Application")
Set oOMail = oOApp.CreateItem(olMailItem)
If strProvider = "Coins" Then
With oOMail
.Subject = "E-Business Invoice File"
.Body = "MLM & WTE Invoices - see please attachment."
.To = strMailadd
.Attachments.Add edifilename
.Send
End With
Is it possible to use something like
Code:
.SendKeys ("{TAB 2}")
.SendKeys ("{Enter}")
Is there any other way without resorting to 3rd party software?
I’ve had a look at thread329-664947 and extracted the following code
Code:
Public Sub email()
Dim myOlapp
Dim olMailItem
Dim myItem
Dim myAttachments
Set myOlapp = CreateObject("Outlook.Application")
Set myItem = myOlapp.CreateItem(olMailItem)
'myItem.Display '-- Optional --
myItem.To = "des.lavender@mlmuk.com"
myItem.Subject = "Message for you sir!"
myItem.Body = "Body here."
'myItem.Save '-- It's advised to save items before
' adding attachments.
Set myAttachments = myItem.Attachments
myAttachments.Add edifilename
'myItem.Send '<-- This causes the "click yes" message
'Instead of myItem.Send, use the SendKeys feature.
AppActivate myItem
SendKeys ("%s")
End Sub
Am I close? Am I nuts?
Many thanks,
Des.