本文整理汇总了C#中Microsoft.Office.Interop.Word.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.Office.Interop.Word.ToString方法的具体用法?C# Microsoft.Office.Interop.Word.ToString怎么用?C# Microsoft.Office.Interop.Word.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Office.Interop.Word
的用法示例。
在下文中一共展示了Microsoft.Office.Interop.Word.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateMappedControl
//.........这里部分代码省略.........
Inline2Block i2b = new Inline2Block();
cc = i2b.convertToBlockLevel(cc, true, true);
if (cc == null)
{
MessageBox.Show("Problems inserting block level XHTML at this location.");
designMode.restoreState();
return;
}
}
}
else if (ContentDetection.IsBase64Encoded(val))
{
isPicture = true;
if (_PictureContentControlsReplace)
{
// Use a rich text control instead
cc = CurrentDocument.ContentControls.Add(
Word.WdContentControlType.wdContentControlRichText, ref missing);
PictureUtils.pastePictureIntoCC(cc, Convert.FromBase64String(val));
}
else
{
// Force picture content control
log.Debug("Detected picture");
cc = CurrentDocument.Application.Selection.ContentControls.Add(Word.WdContentControlType.wdContentControlPicture, ref missing);
}
}
else if (!isFlatOPC)
{
log.Debug("Not picture or XHTML; " + CCType.ToString());
// This formulation seems more susceptible to "locked for editing"
//object rng = CurrentDocument.Application.Selection.Range;
//cc = CurrentDocument.ContentControls.Add(Word.WdContentControlType.wdContentControlText, ref rng);
// so prefer:
cc = CurrentDocument.Application.Selection.ContentControls.Add(CCType, ref missing);
}
XPathsPartEntry xppe = new XPathsPartEntry(controlMain.model);
xppe.setup(null, CurrentPart.Id, strXPath, prefixMappings, true);
xppe.save();
td.set("od:xpath", xppe.xpathId);
if (isFlatOPC)
{
td.set("od:progid", "Word.Document");
cc.Title = "Word: " + xppe.xpathId;
//cc.Range.Text = val; // don't escape it
cc.Range.InsertXML(val, ref missing);
}
else if (isXHTML)
{
td.set("od:ContentType", "application/xhtml+xml");
cc.Title = "XHTML: " + xppe.xpathId;
cc.Range.Text = val;
}
else if (isPicture)
{