
You may want to embed the types of interop assemblies. This gives you independence from office version. To do so:
- Add a reference to the desired office interop assembly, for example
Microsoft.Office.Interop.Word.dll
- Right click on the dll reference and choose properties
- In property window, set
Embed Interop Types
totrue
- Set
Copy to Output Directory
toAlways
to make sure you distribute the assembly with our application - Rebuild and distribute the new build on the target machines.
For more information:
- Implement Send Mail from WinForm using both Outlook 2010 and 2013 C# (My answer on a similar topic)
- Painless Office Interop Using Visual C# article by Claudio Bernasconi.
- Walkthrough: Embed types from managed assemblies in Visual Studio