打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
error C2371: 'FontPtr' : redefinition; different basic types

I'm very glad to share with you the materials of learning Office automation.

 

All-In-One Code Framework

http://cfx.codeplex.com/Wiki/View.aspx?title=All-In-One%20Code%20Framework%20Examples

 

This is a sample code project built by my team. For office automation, you can focus on these examples:

 

CppAutomateWord

CSAutomateWord

VBAutomateWord

 

CppAutomateOutlook

CSAutomateOutlook

VBAutomateOutlook

 

CppAutomateExcel

CSAutomateExcel

VBAutomateExcel

 

The samples’ names imply their meanings. They demonstrate the skeleton of automating office applications. There are currently no sample for PowerPoint automation, but I will add them soon.

 

Each sample has a ReadMe.txt file, where you can find the detailed doc of the sample.

 

If you have any feedback or suggestion for the project, please do email it to codefxf@microsoft.com. We are currently planning for the next stage of CodeFx. Your inputs will be valued.

 

Good morning Rudresh

 

Are you using MFC? I can reproduce the errors. They result from the duplication of names between the tlb generated symbols and the built-in MFC symbols. The solution is to use namespace:

 

Step1. Open each PowerPoint class generated by the MFC class wizard from tlb,

 

Step2. Replace the code

 

#import "C:\\Program Files\\Microsoft Office\\Office12\\MSPPT.OLB" no_namespace

 

with

 

#import "libid:2DF8D04C-5BFA-101B-BDE5-00AA0044DE52" \

                rename("RGB", "MSORGB")

// [-or-]

//#import "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE12\\MSO.DLL" \

//            rename("RGB", "MSORGB")

 

using namespace Office;

 

#import "libid:0002E157-0000-0000-C000-000000000046"

// [-or-]

//#import "C:\\Program Files\\Common Files\\Microsoft Shared\\VBA\\VBA6\\VBE6EXT.OLB"

 

using namespace VBIDE;

 

#import "libid:91493440-5A91-11CF-8700-00AA0060263B"

 

Step3. Rebuild your application.

 

If you have any other questions or concerns, please feel free to tell me.

 

Are you using MFC? I can reproduce the errors. They result from the duplication of names between the tlb generated symbols and the built-in MFC symbols. The solution is to use namespace:

 

Step1. Open each PowerPoint class generated by the MFC class wizard from tlb,

 

Step2. Replace the code

 

#import "C:\\Program Files\\Microsoft Office\\Office12\\MSPPT.OLB" no_namespace

 

with

 

#import "libid:2DF8D04C-5BFA-101B-BDE5-00AA0044DE52" \

                rename("RGB", "MSORGB")

// [-or-]

//#import "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE12\\MSO.DLL" \

//            rename("RGB", "MSORGB")

 

using namespace Office;

 

#import "libid:0002E157-0000-0000-C000-000000000046"

// [-or-]

//#import "C:\\Program Files\\Common Files\\Microsoft Shared\\VBA\\VBA6\\VBE6EXT.OLB"

 

using namespace VBIDE;

 

#import "libid:91493440-5A91-11CF-8700-00AA0060263B"

 

Step3. Rebuild your application.

 

If you have any other questions or concerns, please feel free to tell me.

Regards,

Jialiang Ge


Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
创建MS Office 和 WPS 兼容插件
如何解决Excel打开时总是出现stdole32.tlb的提示
Win.tlb(Ansi) WinU.tlb(Unicode)下载 VB下直接使用API库
office2007老是提示stdole32.tlb怎么办
C++调用C# DLL函数简单介绍
在MFC中使用纯COM方式来操纵Flash OCX (IShockwaveFlash)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服