Jump to content
Xtreme .Net Talk

Recommended Posts

  • 6 years later...
Posted
A different tool to open the archive? It worked fine for me just now.

 

Thanks. I tried downloading it with Firefox and it worked OK. But I get the feeling it's going to take a lot of time to get it up and running. When I try to build (which I think I have to do to be able to register the add-in) I get messages "Cannot implicitly convert type object to Microsoft.Office.Core.CommandBarControl." An explicit conversion exists (are you missing a cast?)."

 

I'm sure I could figure it out, but knowing how many lines are in my code is not that high a priority...

Posted (edited)

Actually, although I don't understand C#, the offending lines look pretty straightforward. One reads

 

_CommandBars commandBars = applicationObject.CommandBars;

 

And the other is pretty similar. I think I just need to know how to do a cast (the equivalent of CType) in C#, or to turn Option Strict off in this project. In VB you can select this on the Compile tab of the project properties, but I can't see anything similar in this (C#) project. Can anyone tell me what I should be doing?

Edited by rbulph
  • Administrators
Posted

C# doesn't have the ability to turn of type checking, a cast is performed by putting the desired type in parenthesis before the type to be casted. e.g.

Dim b as Button = DirectCast(sender, Button)

in c# would be

Button b = (Button) sender;

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
Thanks, it compiles now. But it compiles to a dll whereas an existing add-in that I have is a "Visual Studio Add-in Definition File" in My Documents/Visual Studio 2005/Add-ins. I can copy the dll into this folder, but it doesn't show up in the Add-in Manager. Any thoughts?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...