1
其他類調用
我使用VS2010 - > Extensibility->共享外接IRibbonExtensibility-> GetCustomUI從比Connect.cs
Connect.cs文件
public class Connect : Object, Extensibility.IDTExtensibility2, IRibbonExtensibility
{
public string GetCustomUI(string RibbonID)
{
return MyResources.customUI;
}
}
絲帶被創建使用此以上代碼。
我有類customRibbons.cs
public class Create_Custom_Ribbons : IRibbonExtensibility
{
Outlook.Application applicationObject;
public Create_Custom_Ribbons(Outlook.Application application)
{
try
{
applicationObject = application;
GetCustomUI("");
}
catch(Exception ex)
{
MessageBox.Show(""+ex.StackTrace);
}
}
public string GetCustomUI(string RibbonID)
{
return MyResource.customUI;
}
}
和Connect.cs
public void OnStartupComplete(ref System.Array custom)
{
try
{
customRibbons.Create_Custom_Ribbons cu = new
customRibbons.Create_Custom_Ribbons(applicationObject);
}
catch (Exception ex)
{
MessageBox.Show("" + ex.StackTrace);
}
}
但色帶沒有得到created.Please誰能告訴我我在做什麼錯誤或其他任何實現這一目標的方式。我無法理解它沒有被創建。