View Single Post
  #2  
Old July 10th 07, 08:24 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default 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

Ads