How can I embed any file type into Microsoft Word using OpenXml 2.0

前端 未结 5 2101
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 06:09

I spent a lot of time trying to figure out a good way to embed any file into Microsoft Word using OpenXml 2.0; Office documents are fairly easy but what about other file typ

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-30 06:58

     _objectIcon = Enterprise.Windows.Win32.Win32.GetLargeIcon(_filePathAndName); 
    

    seems to be broken, but

    _objectIcon = System.Drawing.Icon.ExtractAssociatedIcon(_filePathAndName);
    

    should also work.

提交回复
热议问题