阳光VIP

少壮不努力,老大徒伤悲。平日弗用功,自到临期悔。
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Programming Word Add-In Component

Posted on 2012-02-03 12:03  阳光VIP  阅读(113)  评论(0编辑  收藏  举报

1)build up a inprocess component project
2)Add a class named as CFBAddIn implemented the IFBAddIn Interface by using ATL Simple Object Wizard.CFBAddIn supports IsupportErrorInfo interface.
3)Add the functionality implementing the _IDTExtensibility2 event interface in the CFBAddIn class.The interface is decribed in the file C:/Program Files/Common Files/DESIGNER/MSADDNDR.TLB 
4)add these statements to FBAddIn.rgs file
HKCU
{
  Software
  {
    Microsoft
    {
      Office
      {
        Word
        {
          Addins
          {
            'WordAddInDemo.FBAddIn'
            {
              val FriendlyName = s 'WordAddInDemo.FBAddIn'
              val Description = s 'Word Custom Addin'
              val LoadBehavior = d '00000003'
              val CommandLineSafe = d '00000001'
            }
          }
        }
      }
    }
  }
}

5)press ctrl+f5 to run the dll,set the executable file path "D:/Program Files/Microsoft Office/OFFICE11"