Solved

Outlook Macro to Insert Shape

Posted on 2011-02-22
3
1,039 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Granting full access permission allows users to access mailboxes present in their database. By giving full access permission one can open and read the content of any mailbox but cannot send emails from that mailbox.
If you don't know how to downgrade, my instructions below should be helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now