Solved

Outlook Macro to Insert Shape

Posted on 2011-02-22
3
1,068 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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