Solved

Word 2003 and 2007 COM problem

Posted on 2009-05-10
9
551 Views
Last Modified: 2013-11-27
I'm writing a VB.Net app which will populate an Word Document. The app references Word using COM.

I have Office 2003 and 2007 on my machine, but the machine which will be running the application will have Office 2003. Therefore, when I added the Word COM reference, I chose the Word 11 one.

Now that I'm trying the application on another machine I'm getting errors saying that the Microsoft.Office.Interop.Word version 12.0.0.0 is missing. Viewing the object browser I see that Microsoft.Office.Interop.Word is described as:

Assembly Microsoft.Office.Interop.Word
C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Word\12.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Word.dll

This is strange condisering in the Solution Explorer view, I see the properties for the Word Reference set to:
Microsoft.Office.Interop.Word
Microsoft Excel 11.0 Object Library
C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Word\12.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Word.dll

It's saying it's Word 11, but then references the Word 12 interop libraries. I've removed the reference and added it again and it's still the same.

Any suggestions as to how I fix this? I need to keep Office 2003 and 2007 on this machine, but need to be able to build for Word 2003.

Thanks
0
Comment
Question by:Amitava_Mukherjee
  • 5
  • 3
9 Comments
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 24357858
So in the VBE, you go to Tools, References - click on the problem reference and have you tried just browsing to the correct one?
0
 

Author Comment

by:Amitava_Mukherjee
ID: 24360874
Yes, though I select "Microsoft Word 11.0 Object Library", the path is shown as "C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Word\12.0.0.0__71e9bce111e9429c" which is the Word 2007 office related dll.
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 24367893
Then browse to the right one.....yes?
0
 

Author Comment

by:Amitava_Mukherjee
ID: 24394136
I selected the right one, the office 2003 dll but it refers office 2007 dll still
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 37

Accepted Solution

by:
Joanne M. Orzech earned 500 total points
ID: 24426027
How did you "select" it?

Have you tried unchecking the box next to the 2007 library?
0
 

Author Closing Comment

by:Amitava_Mukherjee
ID: 31580037
Thanx, problem solved, actually in developer PC if office 2003 and office 2007 both exists, .net always bind the higher version dll from GAC although user select the lower version dll, .net still refers the higher version dll by default at time of compilation. Removing the higher version office is the only solution.
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 24440791
Oh - well thank you for that.  I was not aware of that.
0
 
LVL 3

Expert Comment

by:saji1976
ID: 24449297
Hi,

In my case, I am using VS 2005 and have both MS Office 2003 and 2007 in my machine.  I am adding a Reference 'Microsoft.Office.Interop.Word or Excel 11.0.0.0' in my project, but the path is referred to c:\windows\assembly\GAC\12.0.0.0.. folder; because of which 2007 is initiated when the application is executed, but i wan Word/Excel 2003 to be opened.  Also my requirement is both 2003 and 2007 will present on the server where the application is running.

Please let me know how to resolve this issue?

Thanks.
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 24450842
This may help - it tells you how to set the default version of Office when multiple versions are installed... however, it only works for Word - not Excel.

http://pubs.logicalexpressions.com/pub0009/LPMArticle.asp?ID=762
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now