Discussion:
How to write a macro in Outlook to perform the menu command "Edit/Paste Special/Text"?
(too old to reply)
M Shafaat
2010-05-12 14:30:34 UTC
Permalink
Hi,
How can I write a macro in Outlook 2003 to perform the menu command
"Edit/Paste Special/Text"?



Regards
M Shafaat
Ken Slovak - [MVP - Outlook]
2010-05-13 13:52:53 UTC
Permalink
Assuming you have an open item where you want this macro to work:

Public Sub PasteMe()
Dim oBar As Office.CommandBar
Dim oButton As Office.CommandBarButton

Set oBar = Application.ActiveInspector.CommandBars.Item("Menu Bar")
Set oButton = oBar.FindControl(Id := 755, Recursive := True)

oButton.Execute
End Sub
--
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
Post by M Shafaat
Hi,
How can I write a macro in Outlook 2003 to perform the menu command
"Edit/Paste Special/Text"?
Regards
M Shafaat
M Shafaat
2010-05-14 20:27:45 UTC
Permalink
Hi Ken,
Thank you very much for your reply, which helps me, even if not whole the
way. The code displays the menu for Paste Special, while I want to perform
"Paste Special/Plain Text" without having to do anything else that
activating the macro.



Is there a way to do that?
Thanks again for your help.
Regards
M Shafaat
Post by Ken Slovak - [MVP - Outlook]
Public Sub PasteMe()
Dim oBar As Office.CommandBar
Dim oButton As Office.CommandBarButton
Set oBar = Application.ActiveInspector.CommandBars.Item("Menu Bar")
Set oButton = oBar.FindControl(Id := 755, Recursive := True)
oButton.Execute
End Sub
--
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
Post by M Shafaat
Hi,
How can I write a macro in Outlook 2003 to perform the menu command
"Edit/Paste Special/Text"?
Regards
M Shafaat
Ken Slovak - [MVP - Outlook]
2010-05-14 20:44:00 UTC
Permalink
That's as far as you can get with code. Selections from submenus like that
can't be automated unless you use SendKeys, and that's not all that
reliable.
--
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
Post by M Shafaat
Hi Ken,
Thank you very much for your reply, which helps me, even if not whole the
way. The code displays the menu for Paste Special, while I want to perform
"Paste Special/Plain Text" without having to do anything else that
activating the macro.
Is there a way to do that?
Thanks again for your help.
Regards
M Shafaat
Loading...