merrymonk has asked for the wisdom of the Perl Monks concerning the following question:
with $intable being 1 with the selection point is in the table and 0 when not. I found in http://www.microsoft.com/technet/scriptcenter/resources/officetips/apr05/tips0407.mspx the following code for VBA$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); }
I always struggle going from VBA to Perl, however, I thought that the following may work.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 = wdColorG +ray10 objSelection.TypeText "This is the first paragraph." objSelection.TypeParagraph()
Sadly nothing happened to either the cell or paragraph background colour. Does any Monk know how to do what I want?</code>$wdColorGray10 = 15132390; $selection->ParagraphFormat->Shading ({BackgroundPatternColor => $wdCo +lorGray10});
|
|---|