Hi Frank,
>Is there any documentation that outlines what, if any,
>changes need to be made?
You needn't to care about this, most of the VS 2003 macro could be used in
VS 2005, actually there is not any big change in VS2005's Macro syntax, we
don't have a specific doc on this topic.
>I am having trouble with the creation of some tool bars. My code uses
>"Imports Microsoft.Office.Core" and I don't see any Office entries when
>trying "Add Reference". (I have installed the Office 2003 primary
>interop assemblies.)
yes, currently the .NET Framework 2.0 directory doesn't contain the Office
2003 interop assembly. you may try to copy it manually, from the GAC
directory:
C:\WINDOWS\assembly\GAC\Office\11.0.0.0__71e9bce111e9429c\Office.dll
to
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50630
Wish it works!
Best regards,
Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn
This posting is provided "AS IS" with no warranties, and confers no rights.
Frank - 26 Aug 2005 19:16 GMT
Gary Chang[MSFT] wrote:
> Hi Frank,
>
[quoted text clipped - 32 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
Gary,
I copied Office.dll as you suggested, and used regasm.exe on Office.dll.
That seemed to correct the error with the "Imports..." statement.
However, when the macro tries to add a command bar, I receive this error:
Unable to cast COM object of type 'System.__ComObject' to interface type
'Microsoft.Office.Core.CommandBar'. This operation failed because the
QueryInterface call on the COM component for the interface with IID
'{000C0304-0000-0000-C000-000000000046}' failed with HRESULT: 0x80004002
(No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE))).
Here is the macro code where the error occurred (on cmdbar = line):
Sub CreateToolbar(ByVal name As String)
Dim cmdbar As CommandBar
cmdbar = DTE.Commands.AddCommandBar(name, _
vsCommandBarType.vsCommandBarTypeToolbar)
' Show the command bar and its button.
cmdbar.Visible = True
End Sub
It looks like something is not registered. Do you have any suggestions
on how to correct this error?
Thanks,
Frank
"Gary Chang[MSFT]" - 27 Aug 2005 09:50 GMT
Hi Frank,
>However, when the macro tries to add a command bar, I
>receive this error:
>Unable to cast COM object of type 'System.__ComObject' to interface type
>'Microsoft.Office.Core.CommandBar'.
yes, it appears the office interop assembly isn't registered well.
But I don't have this problem in my side, I have tested your sample Macro
in the VS2005 IDE, it can add the new command bar as expected. So there may
be some else problem, could you browse all the contained Office interfaces
in the Object Browser of the VS2005's Macro IDE?
Thanks!
Best regards,
Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn
This posting is provided "AS IS" with no warranties, and confers no rights.