![]() |
macros for characters
Before Outlook 2007 all my Word macros for characters worked fine also in
Outlook, as I used Word as Outlook editor. Withthat no longer possible, I have successfully transferred my macros into normalemail.dotm, however they do not execute as intended. All have the typical structu Sub Euro() ' Euro Macro Selection.TypeText Text:="€" End Sub While they execute fine in Word, in Outlook I get an error: Run-Time Error ‘424’: Object Required Any help/suggestions would be appreciated. Peter K |
macros for characters
That's because you're trying to run a Word macro within the Outlook VBA environment. The solution would be to instantiate a Word.Selection object representing the selection in the open email message, something like this:
Dim objDoc As Word.Document Dim objSel As Word.Selection On Error Resume Next Set objDoc = Application.ActiveInspector.WordEditor Set objSel = objDoc.Windows(1).Selection objSel.TypeText "€" -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Peter K" wrote in message ... Before Outlook 2007 all my Word macros for characters worked fine also in Outlook, as I used Word as Outlook editor. Withthat no longer possible, I have successfully transferred my macros into normalemail.dotm, however they do not execute as intended. All have the typical structu Sub Euro() ' Euro Macro Selection.TypeText Text:="€" End Sub While they execute fine in Word, in Outlook I get an error: Run-Time Error ‘424’: Object Required Any help/suggestions would be appreciated. Peter K |
macros for characters
Thxs a lot; I wish though they would not have removed Word as Outlook word
processor. Peter K "Sue Mosher [MVP-Outlook]" wrote: That's because you're trying to run a Word macro within the Outlook VBA environment. The solution would be to instantiate a Word.Selection object representing the selection in the open email message, something like this: Dim objDoc As Word.Document Dim objSel As Word.Selection On Error Resume Next Set objDoc = Application.ActiveInspector.WordEditor Set objSel = objDoc.Windows(1).Selection objSel.TypeText "€" -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Peter K" wrote in message ... Before Outlook 2007 all my Word macros for characters worked fine also in Outlook, as I used Word as Outlook editor. Withthat no longer possible, I have successfully transferred my macros into normalemail.dotm, however they do not execute as intended. All have the typical structu Sub Euro() ' Euro Macro Selection.TypeText Text:="€" End Sub While they execute fine in Word, in Outlook I get an error: Run-Time Error ‘424’: Object Required Any help/suggestions would be appreciated. Peter K |
macros for characters
They didn't remove it. They did just the opposite. Word is now the only editor for Outlook, and it's available for all items except sticky notes. That means that item bodies are fully programmable in ways they never were before -- very good news for developers.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Peter K" wrote in message ... Thxs a lot; I wish though they would not have removed Word as Outlook word processor. Peter K "Sue Mosher [MVP-Outlook]" wrote: That's because you're trying to run a Word macro within the Outlook VBA environment. The solution would be to instantiate a Word.Selection object representing the selection in the open email message, something like this: Dim objDoc As Word.Document Dim objSel As Word.Selection On Error Resume Next Set objDoc = Application.ActiveInspector.WordEditor Set objSel = objDoc.Windows(1).Selection objSel.TypeText "€" "Peter K" wrote in message ... Before Outlook 2007 all my Word macros for characters worked fine also in Outlook, as I used Word as Outlook editor. Withthat no longer possible, I have successfully transferred my macros into normalemail.dotm, however they do not execute as intended. All have the typical structu Sub Euro() ' Euro Macro Selection.TypeText Text:="€" End Sub While they execute fine in Word, in Outlook I get an error: Run-Time Error ‘424’: Object Required Any help/suggestions would be appreciated. Peter K |
macros for characters
I appreciate what you're saying. From ny view, though, previously my Word
macros worked in Outlook. Now they don't. That part has gotten much more complicated. PS: ordered your new book. Peter K "Sue Mosher [MVP-Outlook]" wrote: They didn't remove it. They did just the opposite. Word is now the only editor for Outlook, and it's available for all items except sticky notes. That means that item bodies are fully programmable in ways they never were before -- very good news for developers. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Peter K" wrote in message ... Thxs a lot; I wish though they would not have removed Word as Outlook word processor. Peter K "Sue Mosher [MVP-Outlook]" wrote: That's because you're trying to run a Word macro within the Outlook VBA environment. The solution would be to instantiate a Word.Selection object representing the selection in the open email message, something like this: Dim objDoc As Word.Document Dim objSel As Word.Selection On Error Resume Next Set objDoc = Application.ActiveInspector.WordEditor Set objSel = objDoc.Windows(1).Selection objSel.TypeText "€" "Peter K" wrote in message ... Before Outlook 2007 all my Word macros for characters worked fine also in Outlook, as I used Word as Outlook editor. Withthat no longer possible, I have successfully transferred my macros into normalemail.dotm, however they do not execute as intended. All have the typical structu Sub Euro() ' Euro Macro Selection.TypeText Text:="€" End Sub While they execute fine in Word, in Outlook I get an error: Run-Time Error ‘424’: Object Required Any help/suggestions would be appreciated. Peter K |
macros for characters
I wouldn't call adding a couple of Set statements "much more complicated," certainly not in comparison with the operations in Outlook that really, really are complex.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Peter K" wrote in message ... I appreciate what you're saying. From ny view, though, previously my Word macros worked in Outlook. Now they don't. That part has gotten much more complicated. PS: ordered your new book. Peter K "Sue Mosher [MVP-Outlook]" wrote: They didn't remove it. They did just the opposite. Word is now the only editor for Outlook, and it's available for all items except sticky notes. That means that item bodies are fully programmable in ways they never were before -- very good news for developers. "Peter K" wrote in message ... Thxs a lot; I wish though they would not have removed Word as Outlook word processor. Peter K "Sue Mosher [MVP-Outlook]" wrote: That's because you're trying to run a Word macro within the Outlook VBA environment. The solution would be to instantiate a Word.Selection object representing the selection in the open email message, something like this: Dim objDoc As Word.Document Dim objSel As Word.Selection On Error Resume Next Set objDoc = Application.ActiveInspector.WordEditor Set objSel = objDoc.Windows(1).Selection objSel.TypeText "€" "Peter K" wrote in message ... Before Outlook 2007 all my Word macros for characters worked fine also in Outlook, as I used Word as Outlook editor. Withthat no longer possible, I have successfully transferred my macros into normalemail.dotm, however they do not execute as intended. All have the typical structu Sub Euro() ' Euro Macro Selection.TypeText Text:="€" End Sub While they execute fine in Word, in Outlook I get an error: Run-Time Error ‘424’: Object Required Any help/suggestions would be appreciated. Peter K |
All times are GMT +1. The time now is 07:06 AM. |
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