PDA

View Full Version : Red box macro for Outlook messages



phrankndonna
03-07-2012, 07:19 AM
Good morning,

I've got a macro that I use for MS Word that inserts a box, makes it transparent, and then makes the outside line red. I use this all the time in creating training documents, and I used to be able to use it all the time with emails in Outlook 2003. I use it so much I even have a shortcut key assigned (Shift+Ctrl+R).

Unfortunately, I have not been able to figure out how to make this work in my Outlook 2010 emails, though. I've created a button in a new group and assigned the macro, but it does not seem to work. What might I be doing wrong, and am I able to assign the same keyboard shortcut? Thanks.

Frank

JP2112
03-14-2012, 06:45 AM
Can you post the macro?

phrankndonna
03-17-2012, 08:15 AM
Hi, I'll post it first thing Monday morning.

phrankndonna
03-19-2012, 04:43 AM
Can you post the macro?

Here is the Red Box code. It used to work in both MS Word 2003 and Outlook 2003. It does work fine in MS Word 2010, but not in Outlook anymore. Thanks for any advice.


Sub RedBox()
'
' RedBox Macro
'
'
ActiveDocument.Shapes.AddShape(msoShapeRectangle, 87.9, 71.15, 143.15, _
16.75).Select
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.Fill.Transparency = 1#
Selection.ShapeRange.Line.Weight = 1.5
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.RGB = RGB(255, 0, 0)
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Rotation = 0#
Selection.ShapeRange.Left = 87.8
Selection.ShapeRange.Top = 71.25
Selection.ShapeRange.RelativeHorizontalPosition = _
wdRelativeHorizontalPositionColumn
Selection.ShapeRange.RelativeVerticalPosition = _
wdRelativeVerticalPositionParagraph
Selection.ShapeRange.RelativeHorizontalSize = wdRelativeHorizontalSizePage
Selection.ShapeRange.RelativeVerticalSize = wdRelativeVerticalSizePage
Selection.ShapeRange.Left = InchesToPoints(-0.03)
Selection.ShapeRange.LeftRelative = wdShapePositionRelativeNone
Selection.ShapeRange.Top = InchesToPoints(-0.01)
Selection.ShapeRange.TopRelative = wdShapePositionRelativeNone
Selection.ShapeRange.WidthRelative = wdShapeSizeRelativeNone
Selection.ShapeRange.HeightRelative = wdShapeSizeRelativeNone
Selection.ShapeRange.LockAnchor = False
Selection.ShapeRange.LayoutInCell = True
Selection.ShapeRange.WrapFormat.AllowOverlap = True
Selection.ShapeRange.WrapFormat.Side = wdWrapBoth
Selection.ShapeRange.WrapFormat.DistanceTop = InchesToPoints(0)
Selection.ShapeRange.WrapFormat.DistanceBottom = InchesToPoints(0)
Selection.ShapeRange.WrapFormat.DistanceLeft = InchesToPoints(0.13)
Selection.ShapeRange.WrapFormat.DistanceRight = InchesToPoints(0.13)
Selection.ShapeRange.WrapFormat.Type = 3
Selection.ShapeRange.ZOrder 4
End Sub

JP2112
03-20-2012, 01:19 PM
Yikes. Sorry I can't be more help here.

Maybe something like this can help? http://msdn.microsoft.com/en-us/library/dd492012(v=office.12).aspx

phrankndonna
03-20-2012, 07:34 PM
There are some hints in there, but nothing definitive. There are a lot of things I like about Office 2010, but in regards to VBA programming, in my opinion, they made it more difficult. Thanks for checking this out and trying for me. Much appreciated. Cheers!

Frank