Listing 1: The rgbchart Subroutine Sub rgbchart Const wdCell = 12 Set Word = CreateObject("Word.Application") Set Doc = Word.Documents.Add Word.Visible = True With Word.Selection.font .Name = "Courier New" .Size = 6 End With Word.ActiveWindow.ActivePane.View.Zoom.Percentage = 150 Word.ActiveDocument.Tables.Add word.Selection.Range,1,6,1,0 With Word.Selection.Tables(1) .Columns.PreferredWidth = 72 .Style = "Table Grid" .ApplyStyleHeadingRows = True .ApplyStyleLastRow = False .ApplyStyleFirstColumn = True .ApplyStyleLastColumn = False End With ' BEGIN CALLOUT A stepval = -51 For r = 255 to 0 Step stepval For g = 255 to 0 Step stepval For b = 255 to 0 Step stepval If r <> 255 or g <> 255 or b <> 255 Then Word.Selection.MoveRight wdCell End If Word.Selection.Cells.Shading.BackgroundPatternColor = RGB(r,g,b) Word.Selection.TypeText "rgb(" & r & "," & g & "," & b & ")" Next Next Next ' END CALLOUT A Set Word = Nothing Set Doc = Nothing MsgBox "Done" End Sub