RE: Office 2007 "__missing_type__" while importing msword.olb
- From: jialge@xxxxxxxxxxxxxxxxxxxx (Jialiang Ge [MSFT])
- Date: Wed, 10 Oct 2007 09:51:49 GMT
Hello Mark,
From your post, my understanding on this issue is: you wonder why the twoWindows XP systems with Office XP behave differently when you tries to
import the type libraries of Office 12 on them. If I'm off base, please
feel free to let me know.
In order to reproduce the issue, I did a test on a system with Windows XP
SP2, Office XP SP3 and Visual Studio 2005. I copied the mso.dll,
vbe6ext.olb, msword.olb and msoutl.olb from another system with Office
2007, then add the following content into a VC project's stdafx.h
#import "C:\program files\Common Files\Microsoft Shared\OFFICE12\mso.dll"
rename("RGB", "RGB_"), rename("DocumentProperties", "DocProps"),
rename("FindText", "WordFindText"), rename("PlaySound", "OfficePlaySound")
using namespace Office;
#import "C:\Program Files\Common Files\Microsoft
Shared\VBA\VBA6\1033\VBE6EXT.OLB"
#import "C:\Program Files\Microsoft Office\Office12\MSWORD.OLB"
rename("ExitWindows", "WordExitWindows"), rename("FindText", "WordFindText")
#import "C:\Program Files\Microsoft Office\Office12\MSOUTL.OLB"
rename("CopyFile", "CopyFile_"), rename_namespace("Outlook")
using namespace Outlook;
Then I find that the first compilation of the project does cause the errors
as you mentioned, but when I compile the project again, it passed the
compilation. Although this behavior of compilation is strange, importing
Office 2007 type libraries on a system with Office XP is not an expected
behavior according to the KB article
http://support.microsoft.com/kb/244167. If you want to writing Automation
clients for multiple Office versions, the supported behavior is to
reference the type library of the earliest version of the Office
application you intend to Automate. That is to say, we should #import
Office XP type libraries if our application supports Office XP and above.
Office applications that are tested and compiled with earlier versions of a
type library continue to work, unchanged, when end users of your product
upgrade their Office installations to a more recent version. In this way
Office provides *backward compatibility*. As for this issue, we are
referencing the most recent version of Office in an old version, therefore,
the compilation result is unpredictable. If you decide to support several
versions of Office at the same time, please refer to that KB
http://support.microsoft.com/kb/244167. Thanks.
Please let me know if you have any other concerns, or need anything else.
Sincerely,
Jialiang Ge (jialge@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support
==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Follow-Ups:
- RE: Office 2007 "__missing_type__" while importing msword.olb
- From: Mark Wilson
- RE: Office 2007 "__missing_type__" while importing msword.olb
- Prev by Date: Re: word 2003 add-in : CommandBarButton.State
- Next by Date: RE: Office 2007 "__missing_type__" while importing msword.olb
- Previous by thread: word 2003 add-in : CommandBarButton.State
- Next by thread: RE: Office 2007 "__missing_type__" while importing msword.olb
- Index(es):
Loading