日期:2014-05-17  浏览次数:20879 次

C# office SaveAs 问题
我想做个工具 从doc转docx 用的是office word 14.0的库

doc = app.Documents.Open(textBoxPath.Text + @"\SaveAsDocx\" + nextFile.Name);

SaveAs(doc, WdSaveFormat.wdFormatDocumentDefault, fullPathName);


结果是的确转成了docx 但是用word2010打开 显示的是(兼容模式)

而我们手动另存后是非兼容模式

请问怎样才能另存为非兼容模式呢??
分少 谢谢大家

------解决方案--------------------
OpenFileDialog op = new OpenFileDialog();
if (op.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
Word.Document doc = new Word.Document();
Word.Application app = new Word.Application();
doc = app.Documents.Open(op.FileName);
object fileName = op.FileName+".docx";
object format = Word.WdSaveFormat.wdFormatDocumentDefault;
object missing = Type.Missing;
object mode = Word.WdCompatibilityMode.wdWord2010;
doc.SaveAs2(ref fileName, ref format, ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing
, ref missing, ref mode);
doc.Close();
app.Quit();
GC.Collect();
GC.Collect();
}