Brief introduction
Office2000/xp the implementation of the internal COM plug-ins in Word and the previous article "Office2000 Internal COM Plug-in programming implementation," described in the example Outlook2000 under the internal COM plug-in implementation methods and procedures are basically the same, here, I don't want to do that again. Most of the previous articles have already talked about the content, only focus on the differences between them, interested friends can refer to the previous article, and then see this article will be more than half the effort. This article provides the word internal COM plug-in sample source code after the run of the effect of the diagram below:
Concrete implementation
Next, let's look at what is the difference between the implementation content of the Word2000 vs Outlook2000 internal COM plug-in? You can build an ATL project, name Wordaddin, insert a Simple object, name the Iword2000addin, and other steps to see what I've described in the previous article. Here, in addition to the source content described below need to change, the other part of the source code is basically the same as I said in the article in the example source code, generally do not need to change (unless you have other aspects of special needs).
1th: In the file in the Stdafx.h of the type of import part of the source code will be different, you can replace the source files in the following section can be.
Import the Office2K and word2k type libraries required for the project (the path can be set according to the installation path), Jingzhou Xu
/* Office XP is imported as follows: * *
#import "C:\Program Files\\Common Files\\Microsoft Shared\\office10\\mso. DLL "Rename_namespace" ("Office")
using namespace Office;
#import "D:\\Program Files\\Common Files\\Microsoft Shared\\vba\\vba6 \\VBE6EXT.olb" Rename_namespace ("VBE6")
using namespace VBE6;
#import "D:\Program Files\Microsoft Office\Office10\Msword.olb" rename ("ExitWindows", "ExitWindowsEx"),
Named_guids,rename_namespace ("MSWord")
using namespace MSWord;
/* Import using under Office 2000 * *
#import "E:\\program Files\\Microsoft Office\\office\\mso9.dll" Rename_namespace ("Office")
using namespace Office;
#import "D:\\Program Files\\Common Files\\Microsoft Shared\\vba\\vba6\\vbe6ext.olb" Rename_namespace ("VBE6")
using namespace VBE6;
#import "E:\\program Files\\Microsoft Office\\office\\msword9.olb" rename ("ExitWindows", "ExitWindowsEx"),
Named_guids,rename_namespace ("MSWord")
using namespace MSWord;