Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook prompt when sending attachment!! 1

Status
Not open for further replies.

kculpepper77

Programmer
Mar 21, 2003
15
US
In XP- Office 2002- when I send an attachment using VBA from another application such as Access or Excel, I am prompted by Outlook or Windows(I dont know), but the prompt asks me if I want to send the attachment from the outside program(something along those lines). I would like to turn this off, if possible. Its annoying and also interrupts macros that need to send attachments automatically then move to the next procedure. Thanks.
 
This is Microsofts dammed fool way of trying to plug up gaping security leaks in their protcal.

It's a relativly new feature that is designed to stop virus type programme from relaying themselves around the world.

They've effectivly had to brick up the garage door because someone left a small window open at the back of the house.



G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
This "security" measure I think was added in a service pack to Outlook 2000.

Depending on how you build your e-mail there maybe a way to get around this.

If you are using the SendObject method your stuck. This I believe builds the e-mail and then sends it.

Below is included part of what we use to auto send several e-mails at one time. What we do is after the message is built we open it and then send it. This way you "bypass" the warning message. We have also found that if you set a delay (even 1/2 second) from display to send it seems to work "better".

Set App = CreateObject("Outlook.Application")
Set ITM = App.CreateItem(olMailItem)

With ITM

.Subject = Esubject
.To = SendTo
.Body = Ebody
.Attachments.Add NewFileName
.Attachments.Add IntFile
.Display 'This opens the e-mail for viewing
' .Send 'This sends without opening the e-mail (you will get the prompt)
End With
Call sSleep(ctime)

SendKeys "%{s}", True 'This sends the e-mail (won't work if you are stepping through)
.MoveNext
Loop
End If
End With


Hope this helps. Use what you can.
 
Do a google search for outlook object model guard
Redemption seems great.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
The send keys option worked for me! Thanks Bubba100!
 
I've found the easiest way is to use the CDO commands for sending email, that way it doesn't even touch outlook.
 
Care to expand on that a little more leeh007 ?



G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top