$selection->Find->ClearFormatting; $selection->Find->{Text} = $existing_string; $find_sb_item = $selection->Find->Execute; $intable_res = 0; if($find_sb_item == 1) { $intable_res = $selection->Information(wdWithInTable); } #### Const wdColorWhite = 16777215 Const wdColorGray10 = 15132390 Const wdColorYellow = 65535 Set objWord = CreateObject("Word.Application") objWord.Visible = True Set objDoc = objWord.Documents.Add() Set objSelection = objWord.Selection i = 1 objSelection.ParagraphFormat.Shading.BackgroundPatternColor = wdColorGray10 objSelection.TypeText "This is the first paragraph." objSelection.TypeParagraph() #### $wdColorGray10 = 15132390; $selection->ParagraphFormat->Shading ({BackgroundPatternColor => $wdColorGray10});