JRodrigues
Programmer
Alo,
with Outlook 98, i use the code below and it work's fine...,but with Outlook 2000 , i got the message box, "A program is trying to automatically send e-mail on your behalf.". Is this setup by a security policie ?? Can it be turn off ??? Can i go around it without using a "sendkeys routine" ??!??
The code:
Public Sub MAILME(FILA1 As String, FILA2 As String)
Dim OL As Object
Dim MailSendItem As Object
Dim strToEmail As String
Dim strAttachment1 As String
Dim stmsg As String
Set OL = CreateObject("Outlook.Application"
Set MailSendItem = OL.CreateItem(0)
strToEmail = "jcsrodrigues@clix.pt"
'strAttachment1 = "X:\" + LTrim(RTrim(FILA1)) + ".xls"
With MailSendItem
.Subject = FILA1
.to = strToEmail
stmsg = "Data: " + CStr(Date) + " Hora: " + CStr(Time) + Chr(10) + FILA2
.Body = stmsg
'.Attachments.Add strAttachment1
.NoAging = False 'ensures a response is returned to you if not opened
.Send
Set OL = Nothing
End With
End Sub
TIA
J.RODRIGUES
with Outlook 98, i use the code below and it work's fine...,but with Outlook 2000 , i got the message box, "A program is trying to automatically send e-mail on your behalf.". Is this setup by a security policie ?? Can it be turn off ??? Can i go around it without using a "sendkeys routine" ??!??
The code:
Public Sub MAILME(FILA1 As String, FILA2 As String)
Dim OL As Object
Dim MailSendItem As Object
Dim strToEmail As String
Dim strAttachment1 As String
Dim stmsg As String
Set OL = CreateObject("Outlook.Application"
Set MailSendItem = OL.CreateItem(0)
strToEmail = "jcsrodrigues@clix.pt"
'strAttachment1 = "X:\" + LTrim(RTrim(FILA1)) + ".xls"
With MailSendItem
.Subject = FILA1
.to = strToEmail
stmsg = "Data: " + CStr(Date) + " Hora: " + CStr(Time) + Chr(10) + FILA2
.Body = stmsg
'.Attachments.Add strAttachment1
.NoAging = False 'ensures a response is returned to you if not opened
.Send
Set OL = Nothing
End With
End Sub
TIA
J.RODRIGUES