Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    May 2002
    Location
    Smithfield, Free State, South Africa
    Posts
    210
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA border for picture (MS Publisher 2003)

    Hello
    The code I have tried to insert a light grey border around a selected graphic in MS Publisher does not work.

    Sub bordertest4()
    Selection.ShapeRange.Line.Weight = 4.75
    .DashStyle = msoLineSolid
    .Style = msoLineSingle
    .Transparency = 0#
    .Visible = msoTrue
    .ForeColor.RGB = RGB(578, 578, 578) '(150, 150, 150)
    .BackColor.RGB = RGB(578, 578, 578) '(255, 255, 255)
    End Sub

    Please help.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: VBA border for picture (MS Publisher 2003)

    The arguments for RGB must be in the range 0 ... 255.
    RGB(0, 0, 0) is black, and RGB(255, 255, 255) is white. Unlike what advertisements would have you believe, whiter than white is not possible. Try

    Sub BorderTest4()
    Selection.ShapeRange(1).Line.ForeColor.RGB = RGB(192, 192, 192)
    End Sub

    If that is still too dark, you can try RGB(224, 224, 224), for example.

  3. #3
    3 Star Lounger
    Join Date
    May 2002
    Location
    Smithfield, Free State, South Africa
    Posts
    210
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA border for picture (MS Publisher 2003)

    Wonderful - and thanks too for the information about the colours.
    I see I also left out the (1) after the ShapeRange
    Cheers

  4. #4
    3 Star Lounger
    Join Date
    May 2002
    Location
    Smithfield, Free State, South Africa
    Posts
    210
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA border for picture (MS Publisher 2003)

    Hans,
    How do I set the line thickness to 2?
    Regards

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: VBA border for picture (MS Publisher 2003)

    Sub BorderTest4()
    With Selection.ShapeRange(1).Line
    .ForeColor.RGB = RGB(192, 192, 192)
    .Weight = 2
    End With
    End Sub

Posting Permissions

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