Good day bros. I have some interview transcripts in Word with statements by interviewer and interviewee in successive paragraphs. I want to change the font color of the text in the interviewer paragraphs to a different color. I've verified that the following will open the document and find the interviewer paragraphs:
#!/usr/bin/perl -w
use strict;
use Win32::OLE;
my $document_name = 'C:\Users\boss\worddoc.doc';
my $word = Win32::OLE->GetActiveObject('Word.Application')
|| Win32::OLE->new('Word.Application','Quit')
or die Win32::OLE->LastError();
my $document = $word->Documents->Open($document_name)
or die Win32::OLE->LastError();
my $paragraphs = $document->Paragraphs();
my $n_paragraphs = $paragraphs->Count();
for my $p (1..$n_paragraphs) {
my $paragraph = $paragraphs->Item($p);
my $text = $paragraph->Range->Text();
if ($text =~ /interviewer/i) {
print "$text\n\n";
}
}
$document->close;
But how do I change the text color of these paragraphs?