Solved

Outlook Macro to Insert Shape

Posted on 2011-02-22
3
1,082 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
3 Comments
 
LVL 30

Assisted Solution

by:SiddharthRout
SiddharthRout earned 100 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 400 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 Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

839 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