Outlook 2007 Macro (Can't Create Object)

Joined
Aug 9, 2009
Messages
6
Reaction score
0
I have been using some Outlook 2007 macros successfully for some time ... such as:

Sub Blue()
Dim objDoc As Word.Document
Dim objSel As Word.Selection
Set objDoc = Application.ActiveInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
objSel.Font.Color = wdColorBlue
Set objSel = Nothing
Set objDoc = Nothing
End Sub

But this one gives an error (ActiveX component can't create object):

Sub SingleSpace()
Dim objDoc As Word.Document
Dim objSel As Word.Selection
Set objDoc = Application.ActiveInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
objSel.ParagraphFormat.LeftIndent = InchesToPoints(0)
Set objDoc = Nothing
Set objSel = Nothing
End Sub

Complains about the "objSel.ParagraphFormat.LeftIndent" line. Any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top