0

How to have multiple font style in a single string.

I have a big string and i will append that string to a microsoft word from c# windows application.

I want some characters to be bold... some with big font. like that.

I tried with ordinary HTML tags like < b > bold ..< / b> it wont work..

I want string with mixed font styles.

  Text  BOLD  small BIG 

I am Exporting that string to a word file from c# windows application as i mentioned.

Help Much appreciated.

SeanC
  • 15,695
  • 5
  • 45
  • 66
Learner
  • 346
  • 1
  • 6
  • 16

3 Answers3

0

the keyword of your question is RTF, RichText format string see

Community
  • 1
  • 1
aifarfa
  • 3,939
  • 2
  • 23
  • 35
0

You can use RTF - see "How to paste a Rich Text Format string into Word with Visual Basic Automation" for an example (in VB.Net, but it would work the same in C#)

stuartd
  • 70,509
  • 14
  • 132
  • 163
0

There is no style for a string. A string is a list of characters, that's all.

If you want to copy/paste a styled text to word, you'll have to export it in another format first. You could use HTML or RTF.

This lib might help you.

ken2k
  • 48,145
  • 10
  • 116
  • 176