开发者

Document.SaveAs method?

A template report with extension *.docm will be shown to user, he will modify it, and when he click the save button. I want to write the modified the document as accessionID.docm at the specified folder. What must be the object 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);
    }
}


Use

Word.WdSaveFormat.wdFormatXMLDocumentMacroEnabled

if you want to get a macro-enabled document.


Word.WdSaveFormat.wdFormatDocument;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜