$table->Cell(1,1)->Range->{Shading}->{BackgroundPatternColor} = 254; #### use strict; use warnings; #create a word doc with all the background colour codes use Win32::OLE; my $word = CreateObject Win32::OLE 'Word.Application' or die $!; $word->{'Visible'} = 1; my $document = $word->Documents->Add; my $colour=0; my $selection = $word->Selection; my $table = $document->Tables->Add($selection->Range,2000,1); for (0..2000) { $table->Cell($colour,1)->Range->{Text} = "Colour $colour"; $table->Cell($colour,1)->Range->{Shading}->{BackgroundPatternColor} = $colour; $selection->TypeParagraph; $selection->TypeParagraph; $selection->MoveDown({count=>1}); $colour++; }