+ Reply to Thread
Results 1 to 5 of 5

WordArt - changing text color in code

  1. #1
    Forum Contributor
    Join Date
    06-27-2006
    Posts
    310

    WordArt - changing text color in code

    Could someone help me with this.

    I recorded a macro changing the forecolor of a Wordart and got this for blue

    ActiveSheet.Shapes("WordArt 35").Select
    Selection.ShapeRange.Fill.Visible = msoTrue
    Selection.ShapeRange.Fill.Solid
    Selection.ShapeRange.Fill.ForeColor.SchemeColor = 12
    Selection.ShapeRange.Fill.Transparency = 0#
    Selection.ShapeRange.Line.Weight = 0.75
    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(0, 0, 0)
    Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)

    and this for white

    ActiveSheet.Shapes("WordArt 35").Select
    Selection.ShapeRange.Fill.Visible = msoTrue
    Selection.ShapeRange.Fill.Solid
    Selection.ShapeRange.Fill.ForeColor.SchemeColor = 9
    Selection.ShapeRange.Fill.Transparency = 0#
    Selection.ShapeRange.Line.Weight = 0.75
    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(0, 0, 0)
    Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)

    So I reduced my code to the color scheme and get a message that says
    the 'property or method is not supported by this object'.

    Here is what I have tried
    Sheet1.Shapes("WordArt 35").Fill.ForeColor.SchemeColor = 12
    and
    Sheet1.Shapes("WordArt 35").ForeColor.SchemeColor = 12
    and
    Sheet1.Shapes("WordArt 35").ShapeRange.Fill.ForeColor.SchemeColor = 12




    Thank You
    Last edited by SuitedAces; 01-20-2007 at 11:43 AM.

  2. #2
    Forum Contributor
    Join Date
    11-29-2003
    Posts
    1,203
    The first one you tried should have worked. But, let me show you how I attack an issue like this ... it might help.

    I start the way you did, with the macro recorder. Then, I try to dimension each item to be sure that I have the correct references to the correct objects ... which the macro recorder somehow seems to miss pretty often with its overuse of "Selection".

    In this case ..
    Please Login or Register  to view this content.
    This way, I am always picking items from a list provided by VB. It does not ALWAYS work. At times there are options that exist, but are not provied by the VB drop-down. But, it usually works.

    In this case ...

    Please Login or Register  to view this content.
    I run it ... it works.

  3. #3
    Forum Contributor
    Join Date
    06-27-2006
    Posts
    310
    I got this to work.

    Please disregard my question.

  4. #4
    Forum Contributor
    Join Date
    06-27-2006
    Posts
    310
    MS that you for your reply I must have posted my response at about the same time you were replying.

    I didnt see any reply at the time I posted to disregard.

    I certainly would not have posted that as a reply have I seen your post.

    I appreciate your help and my line of code matches yours.

  5. #5
    Forum Contributor
    Join Date
    11-29-2003
    Posts
    1,203
    Thanks for the feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1