How to create a task pane in Office using pure C++/COM?

燕鹏 李 301 Reputation points
2022-04-15T03:44:02.46+00:00

I am very interested in the technology behind office add-ins. I have learned a little about its history, and know about several technologies that can be used to develop add-ins.

  1. Office.js
  2. VSTO
  3. COM Shim
  4. COM

I don't have good knowledge of Shim, maybe I am wrong in making it a separate category. After getting the book on VSTO(the book was published in 2007), I tried how to develop an office add-in using VSTO. I also do some extra development, such as embedding the Chromium kernel, so that I can load web pages using Chromium, instead of the IE kernel(it doesn't have good support on the new web standards).

What makes me sad is that, for using VSTO, I have to install the new two libraries, one is the .net framework, and the other is vstor(vsto runtime). On some machines, I cannot install these libraries successfully, so I prepare to develop office add-ins(in my case, the Word add-in) using C++/COM. (I guess Office was constructed using COM, we can use pure C++ to develop an add-in not depending on other libraries.)

But the really hard part is that COM technology is not popular now (sorry for what is popular) and the method of how to develop office add-ins using COM is even lost! I cannot search for any useful information on this topic on the Microsoft website.

Everything needs a start, my aim is to create a task pane(I need this to load web pages later) using C++/COM, but now, I don't how to achieve this, so I ask this question here, wishing to get some help.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,519 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,459 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 55,041 Reputation points
    2022-04-16T19:09:45.903+00:00

    com addins are only for legacy office applications. Also they are only supported for the desktop windows versions. Though I would not be surprised if even this support is dropped.

    As the cloud became more important, a new plug-in architecture was developed for office. Now plug-ins are developed with html/css and JavaScript. The actual exchange server can serve as the installer (store) , and they work cross platform.

    https://learn.microsoft.com/en-us/office/dev/add-ins/develop/develop-overview

    The Office team supplies react components for all the office style controls, and matching css for office look. If you pick another framework besides react, they have a standalone sass/css package. The office team tends to use react for the official plug-ins so they are a good choice. You just need node installed to develop.

    React fabric ui (sample code builds task pane)

    https://learn.microsoft.com/en-us/office/dev/add-ins/design/using-office-ui-fabric-react

    Fabric ui sass

    https://learn.microsoft.com/en-us/office/dev/add-ins/design/fabric-core

    Not sure why you would invest time learning an obsolete technology. The time it takes to learn to write a simple com component (office add-ins require discovery also be coded), you could probably code the complete plug-in modern style.