Quantcast
Channel: NetOffice - MS Office in .NET
Viewing all articles
Browse latest Browse all 1741

New Post: Multiple fonts in a single Word Table Cell (C#)

$
0
0
I've seen a lot of VB examples where you specify a start and length to a range of a Word table cell, but how do you do that in C#? So far I have been able to edit the font in a cell but only 1 character at a time which gets really slow with a lot of text.

This works setting "position" in a little for loop but I'm sure is wildly inefficient not setting a whole range at a time:
table.Cell(row, column).Range.Characters[position].Font.Size = 10;
table.Cell(row, column).Range.Characters[position].Font.Bold = 1;
table.Cell(row, column).Range.Characters[position].Font.Italic = 0;
Thanks!

Viewing all articles
Browse latest Browse all 1741

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>