In my program I use Microsoft Word 12.0 Object Library to automate Word and my system has Office2007 installed. If i pack this project and gives to my customer, it causes any problem?
My customer’s computer should have Office 2007 installed in it for working of my program? What happens if he has only Office2003? If any problems is caused what is correct method to solve it or dynamically change the reference back to 11.0 Object Library?
When I checked “My Reference” from Project properties window, it lists three references:
Microsoft Office 12.0 Object Library --> vpp\obj\x86\Debug\Interop.Microsoft.Office.Core.dll
Microsoft Visual Basic for Applications Extensibility 5.3 --> vpp\obj\x86\Debug\Interop.VBIDE.dll
Microsoft Word 12.0 Object Library --> vpp\obj\x86\Debug\Interop.Microsoft.Office.Interop.Word.dll
These three dlls are in my debug folder. So it will work in my customer’s computer?
If you are using early binding you may get error described in The Microsoft.Office.Interop.Word assembly version is higher than referenced (it’s C# example but in VB it’s going to look similar).
About differences between late binding and early binding you can read in Binding for Office automation servers with Visual C# .NET (still C# eaxamples) and Using early binding and late binding in Automation describes how to do it in VB.
Code might look like this (example from VBA – Word – Open Word using Late Binding):
Added:
“Late binding” means “no intellisense”, so have look at Take advantage of Intellisense when writing late bound code.