Saving Word document

后端 未结 3 1025
误落风尘
误落风尘 2021-01-21 18:32

I would like to save a Word document according to the Word installed version;

In case it is Word 2003 (appropriate version number is 11), with DOC exten

3条回答
  •  萌比男神i
    2021-01-21 18:46

    Not sure the API is exactly the same between different word versions.

    If I can make a suggestion - use NetOffice( see link) instead of the office interop assemblies.

    the API is the same as the Office Interop API, and it will work with all (current) versions of Microsoft Office.

    NB - Here is a sample: http://netoffice.codeplex.com/wikipage?title=Word_Example01

    You should import the following namespaces to get it to work:

    using NetOffice;
    using Word = NetOffice.WordApi;
    using NetOffice.WordApi.Enums;
    using Office = NetOffice.OfficeApi;
    

提交回复
热议问题