用这个不就好了?
object fileName = Environment.CurrentDirectory+"\\example.doc";doc.SaveAs ( ref fileName,ref optional, ref optional,  ref optional, ref optional,      ref optional, ref optional,   ref optional,     ref optional,      ref optional,
ref optional);

解决方案 »

  1.   

    To xiongchen(二氧化鬼)能说明白一点吗?另外,这个和File.Create(filePath)有什么不同?我在另一个函数调用
    File.Create(filePath);
    OpenDoc(wordPath,filePath);private void OpenDoc(string extPath,string filePath)
    {
        Process p = new Process();
        p.StartInfo.FileName=extPath;
        p.StartInfo.UseShellExecute = false;
        p.StartInfo.RedirectStandardInput = true;
        p.StartInfo.RedirectStandardOutput = true;
        p.StartInfo.RedirectStandardError = true;
        p.StartInfo.CreateNoWindow = true;
        p.StartInfo.Arguments=filePath;
        p.Start();
    }打开word的时候,总是弹出错误对话框,提示“文档的名称或路径无效……”
      

  2.   

    首先要导入Word.dllnamespace sample2
    {
    /// <summary>
    /// Class1 的摘要说明。
    /// </summary>
    class Class1
    {
    /// <summary>
    /// 应用程序的主入口点。
    /// </summary>
    [STAThread]
    public static int Main (string[] argv)
    {
    Application app = new Application();  
    app.Visible=true; // Set up to create a plain, empty text document.
    // Setting these variables to Missing.Value is comparable.
    // to not providing a value for an optional parameter in VB.
    // This gets the default behavior.
    object template=Missing.Value; //No template.
    object newTemplate=Missing.Value; //Not creating a template.
    object documentType=Missing.Value; //Plain old text document.
    object visible=true; //Show the doc while we work.
    _Document doc = app.Documents.Add( ref template,
    ref newTemplate,
    ref documentType,
    ref visible); Thread.Sleep (5000);  //Display the empty document for 5 seconds.
    doc.Words.First.InsertBefore ("This document is no longer empty!");
    Thread.Sleep (5000);  //Wait for 5 more seconds //Save the file, use default values except for filename.
    object fileName = Environment.CurrentDirectory+"\\example2_new";
    object optional = Missing.Value; //Take default values.
            
    #if OFFICEXP
            doc.SaveAs2000( ref fileName,#else
    doc.SaveAs ( ref fileName,
    ref optional,
    ref optional,
    ref optional,
    ref optional,
    ref optional,
    #endif
    ref optional,
    ref optional,
    ref optional,
    ref optional,
    ref optional,
    ref optional,
    ref optional,
    ref optional,
    ref optional,
    ref optional); // Now use the Quit method to cleanup.
    object saveChanges = true;
    app.Quit(ref saveChanges, ref optional, ref optional);
    Console.Read();
    return 0;
    }
    }
    }
      

  3.   

    To  foolnet(foolnet)直接调word,不使用word控件可以吗?
      

  4.   

    To readersm68(Up) 大哥,你就当 foolnet(foolnet) 添加了Microsoft Word 9.0 Object Library的COM引用好了。另外,有解决办法吗?