Solved

Outlook Macro to Insert Shape

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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
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…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

691 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