我为标签手动设置了字体,但是,当我将其保存为 Word 文档时,我之前设置的字体消失了。我不知道如何弄清楚
private void button1_Click(object sender, EventArgs e)
{
string text = label1.Text + textBox1.Text + "\r\n\r\n\r\n" +
label2.Text + textBox2.Text + "\r\n\r\n\r\n";
sSaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "Microsoft Word| *.doc";
if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string path = sfd.FileName;
MessageBox.Show(path);
if (!File.Exists(path))
{
using (StreamWriter sw = File.CreateText(path))
{
sw.WriteLine(text);
}
}
}
}