Programming implementation of internal COM plug-in in WORD2000/XP

Source: Internet
Author: User

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;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.