D
David
I have created a new project and im trying to follow Ted Pattison's "Office
Developer Screencast" for creating your own ribbon. Im upto the stage of
running the setup program and checking to see if the new ribbon loads but it
lists the COM add-in under the Inactive section and when you try to add the
DLL manually it says "this is no a valid office addin". Any ideas? I have a
fresh install of XP with Visual Studio 2005, Office Beta 2 with Technical
Refresh. I haven't installed the latest SDK or Office Beta Tools as i don't
think at this stage i need them.
namespace TestMacros
{
using System;
using Extensibility;
using System.Runtime.InteropServices;
using Microsoft.Office.Core;
using System.Reflection;
using System.IO;
[GuidAttribute("1E5B1562-A0EF-47B9-9AE5-D3D575A3E82A"),
ProgId("DPPMacros.Connect")]
public class Connect : Object, Extensibility.IDTExtensibility2,
IRibbonExtensibility
{
public Connect()
{
}
public void OnConnection(object application, Extensibility.ext_ConnectMode
connectMode, object addInInst, ref System.Array custom)
{
applicationObject = application;
addInInstance = addInInst;
}
public void OnDisconnection(Extensibility.ext_DisconnectMode disconnectMode,
ref System.Array custom)
{
}
public void OnAddInsUpdate(ref System.Array custom)
{
}
public void OnStartupComplete(ref System.Array custom)
{
}
public void OnBeginShutdown(ref System.Array custom)
{
}
private object applicationObject;
private object addInInstance;
#region IRibbonExtensibility Members
public string GetCustomUI(string RibbonID)
{
Assembly asm = Assembly.GetExecutingAssembly();
Stream stream =
asm.GetManifestResourceStream("TestMacros.Resources.TestMacros.xml");
StreamReader reader = new StreamReader(stream);
string ribbon = reader.ReadToEnd();
reader.Close();
stream.Close();
return ribbon;
}
#endregion
}
}
*****XML File********
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="TabTestMacros" label="DPP">
<group id="grpTestMarcos" label="DPP2">
<button id="cmdSmilieFace" imageMso="New" label="test" size="normal"
onAction="loadMacros" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Developer Screencast" for creating your own ribbon. Im upto the stage of
running the setup program and checking to see if the new ribbon loads but it
lists the COM add-in under the Inactive section and when you try to add the
DLL manually it says "this is no a valid office addin". Any ideas? I have a
fresh install of XP with Visual Studio 2005, Office Beta 2 with Technical
Refresh. I haven't installed the latest SDK or Office Beta Tools as i don't
think at this stage i need them.
namespace TestMacros
{
using System;
using Extensibility;
using System.Runtime.InteropServices;
using Microsoft.Office.Core;
using System.Reflection;
using System.IO;
[GuidAttribute("1E5B1562-A0EF-47B9-9AE5-D3D575A3E82A"),
ProgId("DPPMacros.Connect")]
public class Connect : Object, Extensibility.IDTExtensibility2,
IRibbonExtensibility
{
public Connect()
{
}
public void OnConnection(object application, Extensibility.ext_ConnectMode
connectMode, object addInInst, ref System.Array custom)
{
applicationObject = application;
addInInstance = addInInst;
}
public void OnDisconnection(Extensibility.ext_DisconnectMode disconnectMode,
ref System.Array custom)
{
}
public void OnAddInsUpdate(ref System.Array custom)
{
}
public void OnStartupComplete(ref System.Array custom)
{
}
public void OnBeginShutdown(ref System.Array custom)
{
}
private object applicationObject;
private object addInInstance;
#region IRibbonExtensibility Members
public string GetCustomUI(string RibbonID)
{
Assembly asm = Assembly.GetExecutingAssembly();
Stream stream =
asm.GetManifestResourceStream("TestMacros.Resources.TestMacros.xml");
StreamReader reader = new StreamReader(stream);
string ribbon = reader.ReadToEnd();
reader.Close();
stream.Close();
return ribbon;
}
#endregion
}
}
*****XML File********
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="TabTestMacros" label="DPP">
<group id="grpTestMarcos" label="DPP2">
<button id="cmdSmilieFace" imageMso="New" label="test" size="normal"
onAction="loadMacros" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>