Consulting

Results 1 to 6 of 6

Thread: Red box macro for Outlook messages

  1. #1

    Red box macro for Outlook messages

    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

  2. #2
    VBAX Expert JP2112's Avatar
    Joined
    Oct 2008
    Location
    Astoria, NY
    Posts
    590
    Location
    Can you post the macro?
    Regards,
    JP

    Read the FAQ
    Getting free help on the web
    My website
    Please use [vba][/vba] tags when posting code

  3. #3
    Hi, I'll post it first thing Monday morning.

  4. #4

    Red Box macro in Outlook

    Quote Originally Posted by JP2112
    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.

    [vba]
    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
    [/vba]

  5. #5
    VBAX Expert JP2112's Avatar
    Joined
    Oct 2008
    Location
    Astoria, NY
    Posts
    590
    Location
    Yikes. Sorry I can't be more help here.

    Maybe something like this can help? http://msdn.microsoft.com/en-us/libr...ffice.12).aspx
    Regards,
    JP

    Read the FAQ
    Getting free help on the web
    My website
    Please use [vba][/vba] tags when posting code

  6. #6
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •