gpt4 book ai didi

c# - Document.SaveAs 方法?

转载 作者:太空狗 更新时间:2023-10-30 01:27:10 26 4
gpt4 key购买 nike

扩展名为 *.docm 的模板报告将显示给用户,他将对其进行修改,然后单击保存按钮。我想将修改后的文档写入指定文件夹中的 accessionID.docm。对象 FileFormat = 必须是什么?

private void btnSaveDocument_Click(object sender, EventArgs e)
{
if (m_docFileName == ReportWrite.m_templateReport)
{
m_docFileName = ReportWrite.m_accessionId.ToString();
object FileName = RIS_CLIENT.Properties.Settings.Default.DownloadPath + "\\" + m_docFileName;
object FileFormat = Word.WdSaveFormat.wdFormatRTF;
object LockComments = false;
object AddToRecentFiles = false;
object ReadOnlyRecommended = false;
object EmbedTrueTypeFonts = false;
object SaveNativePictureFormat = true;
object SaveFormsData = false;
object SaveAsAOCELetter = false;
object missing = false;

objWinWordControl.document.SaveAs(
ref FileName,
ref FileFormat,
ref LockComments,
ref missing,
ref AddToRecentFiles,
ref missing,
ref ReadOnlyRecommended,
ref EmbedTrueTypeFonts,
ref SaveNativePictureFormat,
ref SaveFormsData,
ref SaveAsAOCELetter);
}
}

最佳答案

使用

Word.WdSaveFormat.wdFormatXMLDocumentMacroEnabled

如果你想获得启用宏的文档。

关于c# - Document.SaveAs 方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3415251/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com