Document.SaveAs Method?

A report on the template with the extension * .docm will be shown to the user, he will change it, and when he clicks the save button. I want to write a modified document as accessionID.docm in the specified folder. What should 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); } } 
+4
source share
2 answers

Using

 Word.WdSaveFormat.wdFormatXMLDocumentMacroEnabled 

if you want a macro-enabled document.

+3
source

Word.WdSaveFormat.wdFormatDocument;

+1
source

All Articles