?
Solved

Outlook macro to set paragraph spacing

Posted on 2009-04-10
4
Medium Priority
?
531 Views
Last Modified: 2012-05-06
Can someone show me how to write an Outlook 2007 macro that I can hookup to a button that does what the code  below (lifted from Word) does:


Function para()
  With Selection.ParagraphFormat
    .SpaceAfter = 12
    .SpaceBefore = 12
  End With
End Function

Open in new window

0
Comment
Question by:tfield98
  • 2
  • 2
4 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 24119557
Hi, tfield98.

Try this.
Function para()
    Dim olkDoc As Object, _
        wrdSelection As Object
    Set olkDoc = Application.ActiveInspector.WordEditor
    Set wrdSelection = olkDoc.Application.Selection
    With wrdSelection.ParagraphFormat
        .SpaceAfter = 12
        .SpaceBefore = 12
    End With
    Set olkDoc = Nothing
    Set wrdSelection = Nothing
End Function

Open in new window

0
 

Author Closing Comment

by:tfield98
ID: 31569075
Perfect! Exactly what I was looking for. Thanks so much!!
0
 
LVL 76

Expert Comment

by:David Lee
ID: 24119725
You're welcome.  Glad I could help.
0
 

Author Comment

by:tfield98
ID: 24119750
Although Outlook has a default template for new emails, I hadn't found a way to have the format of replies set to a default. I was doing it by hand.  This macro lets me simplify the process. It's been bugging me for years!!  Thanks again, BDF!
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
MS Outlook undoubtedly is the most widely used email client.Its user-friendliness, cost effectiveness, and availability with Microsoft Office Suite make it the most popular email application.  Its compatibility with Microsoft applications like Exch…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question