|
-
Jun 10th, 2006, 10:23 AM
#11
New Member
My Findings...
If you develop on a machine with VS2005 and Office 2003 but you want this code to work on a PC with Office XP
Hey again Robdog, and others... sorry for taking a long time to get back, I've been playing with the PIA's and learning the ins and outs, and how to get this code to work on an Office XP machine when compiling in a VS2005 environment with Office 2003 installed.
I found the best way to get this to work is to simply to get the XP PIAs and reference them instead.. the idea being building from the lowest common denominator will ensure backward compatibility.
So, for people doing what I'm doing here's an idea...
1) download the XP PIA's available from Microsoft. http://www.microsoft.com/downloads/d...displaylang=en
2) Extract them to some folder in your project dir (anywhere is ok, but for this example I'm saying extract to a folder named XP_PIA_COMs)
3) In visual studio...drop the project's reference to the version 11 (Office 2003) Microsoft.Office.Interop.Word.dll
4) Finally, Add a new reference to the OFFICE XP COM library by browsing to the XP_PIA_COMs directory chosing Microsoft.Office.Interop.Word.dll.
Now it will build properly using Early binding, it will run on a machine with Office 2003 and will also be backwards compatible to Office XP machines.
KEEP IN MIND, if you already develop on a machine with Office XP, you will by default have the XP (2002) PIAs, *and* you have less chance of encountering any issues.
A note re Late Binding: I believe even if you were to do this using a late binding reference, you would still have to have the XP PIAs. Late binding is a pain in VS2005 and this is by far an easier out... in my humble opinion.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|