![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I have an Excel macro that sends e-mails via Outlook, using the VBA "Send
Method." For each message sent, Outlook displays a warning requiring a "Yes" response. Is there a way, either in Outlook or in the Excel macro, to generate an automatic reply to these messages? |
Ads |
#2
|
|||
|
|||
![]()
Since that is using a Simple MAPI call none of the usual workarounds for
using Outlook automation will work for you such as Redemption (www.dimastr.com/redemption). Try searching for "ClickYes" as a possible workaround for you when using Simple MAPI calls that trigger the Outlook object model guard. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "wpiet" wrote in message ... I have an Excel macro that sends e-mails via Outlook, using the VBA "Send Method." For each message sent, Outlook displays a warning requiring a "Yes" response. Is there a way, either in Outlook or in the Excel macro, to generate an automatic reply to these messages? |
#3
|
|||
|
|||
![]()
Thanks for the suggestion, Ken. I'll be looking into that.
Is it possible to, alternatively, start from Outlook, access the Excel workbook & process the VBA macro there which creates the e-mails & sends them? I'm absolutely new at VB coding. I recorded the macro in Excel to set up the data for the e-mails, then had to figure out a way to add the code to that macro to create & send the e-mails using that data. Everything works perfectly except for having to manually reply to the "Object Model Guard." Thanks, Will "Ken Slovak - [MVP - Outlook]" wrote: Since that is using a Simple MAPI call none of the usual workarounds for using Outlook automation will work for you such as Redemption (www.dimastr.com/redemption). Try searching for "ClickYes" as a possible workaround for you when using Simple MAPI calls that trigger the Outlook object model guard. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "wpiet" wrote in message ... I have an Excel macro that sends e-mails via Outlook, using the VBA "Send Method." For each message sent, Outlook displays a warning requiring a "Yes" response. Is there a way, either in Outlook or in the Excel macro, to generate an automatic reply to these messages? |
#4
|
|||
|
|||
![]()
If you're going to write the code in Outlook, why not just send the
emails from there? You'll have to recode the application, but it's a lot better than having Outlook start Excel only to send emails using Outlook. HTH On Dec 30, 5:17*pm, wpiet wrote: Thanks for the suggestion, Ken. I'll be looking into that. Is it possible to, alternatively, start from Outlook, access the Excel workbook & process the VBA macro there which creates the e-mails & sends them? I'm absolutely new at VB coding. I recorded the macro in Excel to set up the data for the e-mails, then had to figure out a way to add the code to that macro to create & send the e-mails using that data. Everything works perfectly except for having to manually reply to the "Object Model Guard." Thanks, Will "Ken Slovak - [MVP - Outlook]" wrote: Since that is using a Simple MAPI call none of the usual workarounds for using Outlook automation will work for you such as Redemption (www.dimastr.com/redemption). Try searching for "ClickYes" as a possible workaround for you when using Simple MAPI calls that trigger the Outlook object model guard. |
#5
|
|||
|
|||
![]()
If you are running the code from the Outlook VBA project and you use
Application there as your Outlook.Application object you will have a trusted Application object. Then you derive all of your other Outlook objects from that trusted Application object and those objects will be trusted. That will eliminate the security warnings. You can use the Outlook VBA code to open Excel and the workbook you want and use code to extract the contents you want for the emails, all within your Outlook VBA code. That's the way I'd be doing it. The Excel VBA macro code can be moved over to Outlook, you will need to add starter code to start Excel and open the workbook, and to fully qualify all Excel references (Excel.Range instead of Range, etc.). Then the code for the email can be done using Outlook automation code. There should be examples of that sort of thing up on www.outlookcode.com, try searching there for "Excel" and see what turns up. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "wpiet" wrote in message ... Thanks for the suggestion, Ken. I'll be looking into that. Is it possible to, alternatively, start from Outlook, access the Excel workbook & process the VBA macro there which creates the e-mails & sends them? I'm absolutely new at VB coding. I recorded the macro in Excel to set up the data for the e-mails, then had to figure out a way to add the code to that macro to create & send the e-mails using that data. Everything works perfectly except for having to manually reply to the "Object Model Guard." Thanks, Will |
#6
|
|||
|
|||
![]()
My problem is that I don't have a clue what's possible from either
application, since I've never programmed for either one (or done any other VBA coding). As it is, the Excel workbook contains 5 worksheets & the macro does numerous things, involving all of these sheets. The end result of the macro, before the For Each . . . Next loop that accesses Outlook & sends the e-mails, is a 2-column worksheet, one column with e-mail addresses, the other with the corresponding messages. Are you saying that, from an Outlook macro, I can open the Excel workbook, select that worksheet & loop through the rows, creating an e-mail for each one? Can I, in fact, do all the processing of the Excel workbook from the Outlook macro, using CreateObject("Excel.Application") as the starting point, opening the workbook & performing all the steps that are currently contained in the Excel macro? If so, I'm guessing it would mostly require changing the qualifiers on most statements??? Thanks, Will "JP" wrote: If you're going to write the code in Outlook, why not just send the emails from there? You'll have to recode the application, but it's a lot better than having Outlook start Excel only to send emails using Outlook. HTH On Dec 30, 5:17 pm, wpiet wrote: Thanks for the suggestion, Ken. I'll be looking into that. Is it possible to, alternatively, start from Outlook, access the Excel workbook & process the VBA macro there which creates the e-mails & sends them? I'm absolutely new at VB coding. I recorded the macro in Excel to set up the data for the e-mails, then had to figure out a way to add the code to that macro to create & send the e-mails using that data. Everything works perfectly except for having to manually reply to the "Object Model Guard." Thanks, Will "Ken Slovak - [MVP - Outlook]" wrote: Since that is using a Simple MAPI call none of the usual workarounds for using Outlook automation will work for you such as Redemption (www.dimastr.com/redemption). Try searching for "ClickYes" as a possible workaround for you when using Simple MAPI calls that trigger the Outlook object model guard. |
#7
|
|||
|
|||
![]()
Thanks, Ken. I didn't see your post before my response to JP. Yours answered
those questions of mine. Sounds like we're all on the same page, essentially. I think I'm getting the idea. Thanks to both of you. You've been very helpful. Will "Ken Slovak - [MVP - Outlook]" wrote: If you are running the code from the Outlook VBA project and you use Application there as your Outlook.Application object you will have a trusted Application object. Then you derive all of your other Outlook objects from that trusted Application object and those objects will be trusted. That will eliminate the security warnings. You can use the Outlook VBA code to open Excel and the workbook you want and use code to extract the contents you want for the emails, all within your Outlook VBA code. That's the way I'd be doing it. The Excel VBA macro code can be moved over to Outlook, you will need to add starter code to start Excel and open the workbook, and to fully qualify all Excel references (Excel.Range instead of Range, etc.). Then the code for the email can be done using Outlook automation code. There should be examples of that sort of thing up on www.outlookcode.com, try searching there for "Excel" and see what turns up. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "wpiet" wrote in message ... Thanks for the suggestion, Ken. I'll be looking into that. Is it possible to, alternatively, start from Outlook, access the Excel workbook & process the VBA macro there which creates the e-mails & sends them? I'm absolutely new at VB coding. I recorded the macro in Excel to set up the data for the e-mails, then had to figure out a way to add the code to that macro to create & send the e-mails using that data. Everything works perfectly except for having to manually reply to the "Object Model Guard." Thanks, Will |
#8
|
|||
|
|||
![]()
I have some sample code here that shows two different versions of the
same code for Excel and Outlook. http://www.codeforexcelandoutlook.co...asks-to-excel/ It's basically what you and Ken stated -- just declare an object reference to the Excel.Application Object, and you can port your Excel code over to the Outlook VBIDE with minimal changes. HTH On Dec 31 2008, 10:43*am, wpiet wrote: My problem is that I don't have a clue what's possible from either application, since I've never programmed for either one (or done any other VBA coding). As it is, the Excel workbook contains 5 worksheets & the macro does numerous things, involving all of these sheets. The end result of the macro, before the For Each . . . Next loop that accesses Outlook & sends the e-mails, is a 2-column worksheet, one column with e-mail addresses, the other with the corresponding messages. Are you saying that, from an Outlook macro, I can open the Excel workbook, select that worksheet & loop through the rows, creating an e-mail for each one? Can I, in fact, do all the processing of the Excel workbook from the Outlook macro, using CreateObject("Excel.Application") as the starting point, opening the workbook & performing all the steps that are currently contained in the Excel macro? If so, I'm guessing it would mostly require changing the qualifiers on most statements??? Thanks, Will |
#9
|
|||
|
|||
![]()
Jimmy, did you just make a change to your site? I followed the link & was
reading the article but when I looked around the site and tried to go back to the article, I got the "Something's wrong here" page. I am able to access the main blog page, so I did a search on "export," got six results but if I click on any of the result links, I get the same "Something's wrong here" page. I noticed that the link you provided includes "2008/08" in the URL but it redirects & drops the "2008." Thought that might be relevant. -- Will "JP" wrote: I have some sample code here that shows two different versions of the same code for Excel and Outlook. http://www.codeforexcelandoutlook.co...asks-to-excel/ It's basically what you and Ken stated -- just declare an object reference to the Excel.Application Object, and you can port your Excel code over to the Outlook VBIDE with minimal changes. HTH On Dec 31 2008, 10:43 am, wpiet wrote: My problem is that I don't have a clue what's possible from either application, since I've never programmed for either one (or done any other VBA coding). As it is, the Excel workbook contains 5 worksheets & the macro does numerous things, involving all of these sheets. The end result of the macro, before the For Each . . . Next loop that accesses Outlook & sends the e-mails, is a 2-column worksheet, one column with e-mail addresses, the other with the corresponding messages. Are you saying that, from an Outlook macro, I can open the Excel workbook, select that worksheet & loop through the rows, creating an e-mail for each one? Can I, in fact, do all the processing of the Excel workbook from the Outlook macro, using CreateObject("Excel.Application") as the starting point, opening the workbook & performing all the steps that are currently contained in the Excel macro? If so, I'm guessing it would mostly require changing the qualifiers on most statements??? Thanks, Will |
#10
|
|||
|
|||
![]()
Should be fixed now, thank you.
--JP On Jan 2, 9:46*am, wpiet wrote: Jimmy, did you just make a change to your site? I followed the link & was reading the article but when I looked around the site and tried to go back to the article, I got the "Something's wrong here" page. I am able to access the main blog page, so I did a search on "export," got six results but if I click on any of the result links, I get the same "Something's wrong here" page. I noticed that the link you provided includes "2008/08" in the URL but it redirects & drops the "2008." Thought that might be relevant. -- Will |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
VBA TO USE "Reply To" or "From" to send email from excel | wollywoo | Outlook and VBA | 1 | October 24th 08 04:02 PM |
VBA command, "Item.Send" gives Yes/No Prompt. How do I disable pro | neelamani Padhy | Outlook and VBA | 0 | March 5th 08 02:06 PM |
VBA command, "Item.Send" gives Yes/No Prompt. How do I disable pro | neelamani Padhy | Outlook and VBA | 0 | March 5th 08 02:05 PM |
Need to disable "Don't send a response." calendar option. | JB18 | Outlook - Installation | 0 | August 6th 07 08:58 PM |
disable "do not send a request" when deleting scheduled meetings | litrainer | Outlook - Calandaring | 0 | December 26th 06 09:16 PM |