Selasa, 27 September 2011

[ExcelVBA] Re: Microsoft Outlook Pop-up Warning Message

 

Hi Steve,
See if this works. The key is to use keyboard shortcut for Alt+S in the
program.

'set variable to outlook
Set objol = CreateObject("Outlook.Application")

'set up new email
Set objmail = objol.CreateItem(olmailitem)

'in the email set parameters
With objmail

'enter email addresses for recipients\cc\bcc
.To = "test@ubs.com"
' .cc =

'fill subject
.Subject = "Subject Line"

'create message
.Body = "Test Message"
.NoAging = True

'add attachments to email
' .Attachments.Add "Pathofattachment.xls"

'show email
.display
End With
Set objmail = Nothing
Set objol = Nothing

'send the email without prompts
SendKeys "%{s}", True

Kind Regards,
Abhijat.
--- In ExcelVBA@yahoogroups.com, "David Grugeon" <yahoo@...> wrote:
>
> In earlier versions of Outlook than 2010 you could get round it using
VBA in
> the Outlook application and calling that from excel. This does not
work in
> 2010.
>
> There is an application which replaces the outlook object model (cost
$49.00
> per developer) here
http://www.everythingaccess.com/vbMAPI.htm#moreinfo
>
> Or there are programs you can run on the pc which sit and wait for the
> dialog to appear and then push the button. PTFB is one. The freeware
> version is still available on some sites but the current version is
PTFBpro
> which is $39 (I think). This has to be installed and configured on
the PC
> where the program is running.
>
> Best Regards
> David Grugeon
> Excel VBA Group Moderator
>
> -----Original Message-----
> From: ExcelVBA@yahoogroups.com [mailto:ExcelVBA@yahoogroups.com] On
Behalf
> Of sspatriots
> Sent: Tuesday, 27 September 2011 9:01 PM
> To: ExcelVBA@yahoogroups.com
> Subject: [ExcelVBA] Microsoft Outlook Pop-up Warning Message
>
> Hi,
>
> I have the portion of code that will always give me that warning from
> Outlook that "A program is trying to send an e-mail on my behalf...".
Can
> someone tell me how to modify it to stop the warning message? I tried
> putting the following line in front of and behind ".SendMail...", but
I
> think it was in the wrong place both times, because it didn't work.
>
> .Application.DisplayAlerts = False
>
>
> Thanks,
>
> Steve
>
>
> With Destwb
> .SaveAs TempFilePath & TempFileName & FileExtStr,
> FileFormat:=FileFormatNum
> On Error Resume Next
> For I = 1 To 3
> .SendMail "someone@...", _
> "ABC Daily Report; Be sure to Enable Editing when you
launch the
> attachment"
> If Err.Number = 0 Then Exit For
> Next I
> On Error GoTo 0
> .Close SaveChanges:=False
> End With
>
>
>
> ------------------------------------
>
> ----------------------------------
> Be sure to check out TechTrax Ezine for many, free Excel VBA articles!
Go
> here: http://www.mousetrax.com/techtrax to enter the ezine, then
search the
> ARCHIVES for EXCEL VBA.
>
> ----------------------------------
> Visit our ExcelVBA group home page for more info and support files:
> http://groups.yahoo.com/group/ExcelVBA
>
> ----------------------------------
> More free tutorials and resources available at:
> http://www.mousetrax.com
>
> ----------------------------------Yahoo! Groups Links
>

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar