my $doc = $Word->Documents->Open($_[0]) || die("Unable to open document ", Win32::OLE->LastError()); # Open document #my $doc = $MSWord->Documents->Open({FileName=>$_[0]}); # Exit nicely if we couldn't open doc return unless $doc; # Content object my $content=$doc->Content; #my $selection = $word->Selection; print "Finding Tokens...\n"; # Find object my $find=$content->Find; $find->ClearFormatting; $find->{Text}="##TOKEN_REPLACE##"; $find->Replacement->ClearFormatting; $find->Replacement->{Text}=$cant_be_more_than_255