Results 1 to 1 of 1
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Yilgarn region of Toronto, Ontario
    Thanked 0 Times in 0 Posts

    representation of color (Word 2000 et al.)

    Attached is a module which is not terribly ambitious.
    It attempts to coerce a user-tampered string into a color.
    The input can take the form of a label or a long RGB value or an RGB string of three values.
    I do very little error-checking, and not much in the way of recovery.
    It is a prototype for a series of modules which aim to assist management of styles, by migrating styles from a MIF text file (from FrameMaker/Mif2Go) through a table in word to styles.
    A similar prototype is planned for spacing (can be in points, inches, cm or plain numeric) etc.

    <pre>Sub TESTstrEmitString()
    Debug.Assert "Magenta" = strEmitString("Magenta", lngcTypeString)
    Debug.Assert "Magenta" = strEmitString("16711935", lngcTypeString)
    Debug.Assert "Magenta" = strEmitString("255,0,255", lngcTypeString)
    Debug.Assert "Magenta" = strEmitString("(255,0,255)", lngcTypeString)
    Debug.Assert "Magenta" = strEmitString("RGB(255,0,255)", lngcTypeString)
    Debug.Assert 16711935 = strEmitString("Magenta", lngcTypeLong)
    Debug.Assert 16711935 = strEmitString("16711935", lngcTypeLong)
    Debug.Assert 16711935 = strEmitString("255,0,255", lngcTypeLong)
    Debug.Assert 16711935 = strEmitString("(255,0,255)", lngcTypeLong)
    Debug.Assert 16711935 = strEmitString("RGB(255,0,255)", lngcTypeLong)
    Debug.Assert "255,0,255" = strEmitString("Magenta", lngcTypeRGB)
    Debug.Assert "255,0,255" = strEmitString("16711935", lngcTypeRGB)
    Debug.Assert "255,0,255" = strEmitString("255,0,255", lngcTypeRGB)
    Debug.Assert "255,0,255" = strEmitString("(255,0,255)", lngcTypeRGB)
    Debug.Assert "255,0,255" = strEmitString("RGB(255,0,255)", lngcTypeRGB)
    End Sub</pre>

    Attached Files Attached Files

Posting Permissions

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