代码如下
Document d = (Document)oDocument;
d.Save(); object FileName = "c:\\myfile.doc"; object FileFormat = Word.WdSaveFormat.wdFormatText;
object LockComments = false;
object AddToRecentFiles = true;
object ReadOnlyRecommended = false;
object EmbedTrueTypeFonts = false;
object SaveNativePictureFormat = true;
object SaveFormsData = true;
object SaveAsAOCELetter = false;
object Encoding = MsoEncoding.msoEncodingUSASCII;
object InsertLineBreaks = false;
object AllowSubstitutions = false;
object LineEnding = Word.WdLineEndingType.wdCRLF;
object AddBiDiMarks = false; Object missing = Missing.Value;
d.SaveAs(ref FileName, ref FileFormat, ref LockComments,
ref missing, ref AddToRecentFiles, ref missing,
ref ReadOnlyRecommended, ref EmbedTrueTypeFonts,
ref SaveNativePictureFormat, ref SaveFormsData,
ref SaveAsAOCELetter, ref Encoding, ref InsertLineBreaks,
ref AllowSubstitutions, ref LineEnding, ref AddBiDiMarks);
d.Save();
MessageBox.Show("保存成功");
d = null;
Document d = (Document)oDocument;
d.Save(); object FileName = "c:\\myfile.doc"; object FileFormat = Word.WdSaveFormat.wdFormatText;
object LockComments = false;
object AddToRecentFiles = true;
object ReadOnlyRecommended = false;
object EmbedTrueTypeFonts = false;
object SaveNativePictureFormat = true;
object SaveFormsData = true;
object SaveAsAOCELetter = false;
object Encoding = MsoEncoding.msoEncodingUSASCII;
object InsertLineBreaks = false;
object AllowSubstitutions = false;
object LineEnding = Word.WdLineEndingType.wdCRLF;
object AddBiDiMarks = false; Object missing = Missing.Value;
d.SaveAs(ref FileName, ref FileFormat, ref LockComments,
ref missing, ref AddToRecentFiles, ref missing,
ref ReadOnlyRecommended, ref EmbedTrueTypeFonts,
ref SaveNativePictureFormat, ref SaveFormsData,
ref SaveAsAOCELetter, ref Encoding, ref InsertLineBreaks,
ref AllowSubstitutions, ref LineEnding, ref AddBiDiMarks);
d.Save();
MessageBox.Show("保存成功");
d = null;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货