本文整理汇总了C#中Microsoft.Office.Interop.Word.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.Office.Interop.Word.Save方法的具体用法?C# Microsoft.Office.Interop.Word.Save怎么用?C# Microsoft.Office.Interop.Word.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Office.Interop.Word
的用法示例。
在下文中一共展示了Microsoft.Office.Interop.Word.Save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetWordDocumentPropertyValue
private void SetWordDocumentPropertyValue(Word.Document document, string propertyName, string propertyValue)
{
try
{
object builtInProperties;
builtInProperties = document.BuiltInDocumentProperties;
Type builtInPropertiesType = builtInProperties.GetType();
object property = builtInPropertiesType.InvokeMember("Item", System.Reflection.BindingFlags.GetProperty, null, builtInProperties, new object[] { propertyName });
Type propertyType = property.GetType();
propertyType.InvokeMember("Value", BindingFlags.SetProperty, null, property, new object[] { propertyValue });
document.UpdateSummaryProperties();
document.Save();
}
catch (COMException ex)
{
if (ex.ErrorCode == -2146824090)
{
// No problem, user just cancelled out of the save as dialog
return;
}
}
}
示例2: Save
/// <summary>
/// Documentを保存
/// </summary>
/// <param name="doc">Document</param>
public void Save(Word.Document doc)
{
doc.Save();
}
示例3: ReplaceMailMergeField
private static void ReplaceMailMergeField(Dictionary<string, string> dictionary, Word.Document document, Word.Application word)
{
word.Visible = false;
DoReplaceMailMergeField(dictionary, document, word);
document.Save();
word.Visible = true;
word.Activate();
}