我正在使用一些文本填充word 2010中的内容控件。我无法让我的文字走上新台阶。我试过'\ n','\ r',Environment.NewLine,它仍然出现在一行上。Word 2010内容控件新行
什么,我应该使用
我正在使用一些文本填充word 2010中的内容控件。我无法让我的文字走上新台阶。我试过'\ n','\ r',Environment.NewLine,它仍然出现在一行上。Word 2010内容控件新行
什么,我应该使用
任何想法,我相信你可能需要启用MultiLine = True
为CC。请参阅:http://msdn.microsoft.com/en-us/library/microsoft.office.tools.word.contentcontrol.multiline(v=VS.90).aspx
如果你已经这样做了,看到Microsoft Word Document Controls not accepting carriage returns的可能解决方案
你可以使用这样的:如果你正在使用VBA,你正在寻找
private static Run InsertFormatRun(Run run, string[] formatText)
{
foreach (string text in formatText)
{
run.AppendChild(new Text(text));
RunProperties runProps = run.AppendChild(new RunProperties());
Break linebreak = new Break();
runProps.AppendChild(linebreak);
}
return run;
}
是
vbNewLine
这将插入一个完整的换行符。
什么样的CC? – 2011-03-31 15:07:29
我已经尝试了简单和富文本 – Alice 2011-03-31 16:33:14
了解它,请参阅下面的答案。 – 2011-03-31 17:29:16