How to save doc file using C#

前端 未结 3 1351
别那么骄傲
别那么骄傲 2020-12-11 11:16

I have been using the following to code to write in word file but not able to store the word file. Is there any way to store the word file using C# ?

object          


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-11 11:50

    You should just be able to use SaveAs.

    oDoc.SaveAs("MyFile.doc", ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
    

    If you are using .NET 4.0 you don't need the oMissings.

    S

提交回复
热议问题