?
Solved

Outlook Macro to Insert Shape

Posted on 2011-02-22
3
Medium Priority
?
1,146 Views
Last Modified: 2012-06-21
I'm using outlook 2010.  What code would I use to insert a rectangle into the current message.  I then want to format the rectangle to have no fill, and the color red.

Thank you,

Troy
0
Comment
Question by:T1080
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 30

Assisted Solution

by:SiddharthRout
SiddharthRout earned 400 total points
ID: 34961027
One way I can think of doing this (Only if Word is the email editor)

Get the Word.Document object using the Inspector.WordEditor method and then insert a shape.

You may use the Word macro recorder to insert a shape in the document and then use that :)

Sid
0
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 1600 total points
ID: 34961245
Try the following block as you will see the parameters are shape, left, top, width, height

Chris
With Application.ActiveInspector.WordEditor
        With .Shapes.AddShape(msoShapeRectangle, 10, 50, 100, 250)
            .Fill.ForeColor.RGB = RGB(255, 255, 255)
            .Line.ForeColor.RGB = vbRed
        End With
    End With

Open in new window

0
 

Author Closing Comment

by:T1080
ID: 34962033
Thank you!
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Mailbox Overload?
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
Suggested Courses

800 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