![]() |
Mini macro needed
HI all,
I need a very small macro but don't know how to do it. I did a lot of VBA in othe Office applications but I do not know the Outlook Objects. It should just do the following: - Start - A mail is th active window or a single mail is highlighted: Proceed Otherwise: Abort - Reply - in the Reply window: Change format to text only - Exit How can this be done in VBA. THX Marcus |
Mini macro needed
On Thu, 12 Jan 2006 00:38:34 +0100, Marcus O. M. Grabe wrote in
microsoft.public.outlook.program_vba: I need a very small macro but don't know how to do it. I did a lot of VBA in othe Office applications but I do not know the Outlook Objects. It should just do the following: - Start - A mail is th active window or a single mail is highlighted: Proceed Otherwise: Abort - Reply - in the Reply window: Change format to text only - Exit How can this be done in VBA. Try this (quick & dirty): If Not TypeName(ActiveInspector) = "Nothing" Then ActiveInspector.CommandBars("Standard").Controls(" Reply").Execute Else ActiveExplorer.CommandBars("Standard").Controls("R eply").Execute End If ActiveInspector.CommandBars("Menu Bar").Controls("Format").Controls("Plain Text").Execute This will of course present the warning dialogue. There are probably more elegant and less language-dependent solutions. -- Michael Bednarek http://mbednarek.com/ "POST NO BILLS" |
Mini macro needed
On Thu, 12 Jan 2006 02:25:01 GMT, Michael Bednarek
wrote: On Thu, 12 Jan 2006 00:38:34 +0100, Marcus O. M. Grabe wrote in microsoft.public.outlook.program_vba: I need a very small macro but don't know how to do it. I did a lot of VBA in othe Office applications but I do not know the Outlook Objects. It should just do the following: - Start - A mail is th active window or a single mail is highlighted: Proceed Otherwise: Abort - Reply - in the Reply window: Change format to text only - Exit How can this be done in VBA. Try this (quick & dirty): If Not TypeName(ActiveInspector) = "Nothing" Then ActiveInspector.CommandBars("Standard").Controls(" Reply").Execute Else ActiveExplorer.CommandBars("Standard").Controls("R eply").Execute End If ActiveInspector.CommandBars("Menu Bar").Controls("Format").Controls("Plain Text").Execute This will of course present the warning dialogue. There are probably more elegant and less language-dependent solutions. Hi Michael, thank you, works but as you said will still give me the warning message. My Outlook-VBA-'Dummy'-Idea was to set DisplayAlerts=False, but this property doesn't seem to exist in MS Outlook :-( Marcus |
Mini macro needed
Am Thu, 12 Jan 2006 10:21:13 +0100 schrieb Marcus O. M. Grabe:
Marcus, in OL = XP you can set the MailItem´s BodyFormat property. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook On Thu, 12 Jan 2006 02:25:01 GMT, Michael Bednarek wrote: On Thu, 12 Jan 2006 00:38:34 +0100, Marcus O. M. Grabe wrote in microsoft.public.outlook.program_vba: I need a very small macro but don't know how to do it. I did a lot of VBA in othe Office applications but I do not know the Outlook Objects. It should just do the following: - Start - A mail is th active window or a single mail is highlighted: Proceed Otherwise: Abort - Reply - in the Reply window: Change format to text only - Exit How can this be done in VBA. Try this (quick & dirty): If Not TypeName(ActiveInspector) = "Nothing" Then ActiveInspector.CommandBars("Standard").Controls(" Reply").Execute Else ActiveExplorer.CommandBars("Standard").Controls("R eply").Execute End If ActiveInspector.CommandBars("Menu Bar").Controls("Format").Controls("Plain Text").Execute This will of course present the warning dialogue. There are probably more elegant and less language-dependent solutions. Hi Michael, thank you, works but as you said will still give me the warning message. My Outlook-VBA-'Dummy'-Idea was to set DisplayAlerts=False, but this property doesn't seem to exist in MS Outlook :-( Marcus |
Mini macro needed
On Fri, 13 Jan 2006 07:21:19 +0100, Michael Bauer wrote:
Am Thu, 12 Jan 2006 10:21:13 +0100 schrieb Marcus O. M. Grabe: Marcus, in OL = XP you can set the MailItem´s BodyFormat property. Thank you for your answer, but since I'am still on OL2000 it does not help very much. Actually that was exactely what I was looking for but couldn't find. At least your answer shows me that I am not that dummy looser ;-) It's just not there. However.... Can you maybe recall on something from your very first childhood when OL2000 was still a topic: Has there been a way to avoid forced user intervention? Kind regards to wherever you are (and have a nice weekend, if you have weekends wherever you are ;-) )... .... Marcus |
Mini macro needed
Am Fri, 13 Jan 2006 14:52:31 +0100 schrieb Marcus O. M. Grabe:
Marcus, please read here Dmitry´s comment: http://groups.google.de/group/micros...f0528c7b4937fd -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook On Fri, 13 Jan 2006 07:21:19 +0100, Michael Bauer wrote: Am Thu, 12 Jan 2006 10:21:13 +0100 schrieb Marcus O. M. Grabe: Marcus, in OL = XP you can set the MailItem´s BodyFormat property. Thank you for your answer, but since I'am still on OL2000 it does not help very much. Actually that was exactely what I was looking for but couldn't find. At least your answer shows me that I am not that dummy looser ;-) It's just not there. However.... Can you maybe recall on something from your very first childhood when OL2000 was still a topic: Has there been a way to avoid forced user intervention? Kind regards to wherever you are (and have a nice weekend, if you have weekends wherever you are ;-) )... ... Marcus |
All times are GMT +1. The time now is 05:06 PM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com