操作OFFICE需加载OFFICE的库,但同时加载又会带来重名问题#include <stdio.h>
#include <tchar.h>#import "C:\\Program Files\\common files\\microsoft shared\\office12\\MSO.dll"\
rename(_T("RGB"), _T("RGBEx"))\
rename(_T("EOF"), _T("msoEOF"))\
rename("SearchPath","MsoSearchPath")\
rename("DocumentProperties", "MSODocumentProperties")\
rename("DocumentProperties", "DocumentPropertiesXL") exclude("IFont","IPicture")
using namespace Office;#import "C:\\Program Files\\Common Files\\Microsoft Shared\\VBA\\VBA6\\VBE6EXT.OLB"
using namespace VBIDE; #import "D:\\Program Files\\Microsoft Office\\OFFICE12\\MSWORD.OLB" \
rename("ExitWindows","ExitWindowsEx")\
rename("FindText", "FindTextEx")using namespace Word;
#import "D:\\Program Files\\Microsoft Office\\Office12\\MSPPT.OLB"\
rename(_T("RGB"), _T("VisioRGB"))\
//rename("Application","ppt_Application")
using namespace PowerPoint;
#import "D:\\Program Files\\Microsoft Office\\OFFICE12\\EXCEL.EXE" \
rename(_T("DialogBox"), _T("ExcelDialogBox") ) \
rename( _T("RGB"), _T("ExcelRGB") ) \
rename( _T("CopyFile"), _T("ExcelCopyFile") ) \
rename( _T("ReplaceText"), _T("ExcelReplaceText") )\
exclude( "IFont", "IPicture" ) no_dual_interfaces
报错为:
非常多类似的错误
error C2872: “ColorFormat”: 不明确的符号
msppt.tlh(1151) : PowerPoint::ColorFormat”
msword.tlh(17730) : Word::ColorFormat”
“Window”: 不明确的符号
1> 可能是“f:\mycode\judgeencrypt\bisencrypt\bisencrypt\debug\msword.tlh(25303) : Word::Window”
1> 或 “f:\mycode\judgeencrypt\bisencrypt\bisencrypt\debug\vbe6ext.tlh(700) : VBIDE::Window”
1>f:\mycode\judgeencrypt\bisencrypt\bisencrypt\stdafx.h(57): error C2872: “Window”: 不明确的符号
1> 可能是“f:\mycode\judgeencrypt\bisencrypt\bisencrypt\debug\msword.tlh(25303) : Word::Window”
1> 或 “f:\mycode\judgeencrypt\bisencrypt\bisencrypt\debug\vbe6ext.tlh(700) : VBIDE::Window”
急等解释...
#include <tchar.h>#import "C:\\Program Files\\common files\\microsoft shared\\office12\\MSO.dll"\
rename(_T("RGB"), _T("RGBEx"))\
rename(_T("EOF"), _T("msoEOF"))\
rename("SearchPath","MsoSearchPath")\
rename("DocumentProperties", "MSODocumentProperties")\
rename("DocumentProperties", "DocumentPropertiesXL") exclude("IFont","IPicture")
using namespace Office;#import "C:\\Program Files\\Common Files\\Microsoft Shared\\VBA\\VBA6\\VBE6EXT.OLB"
using namespace VBIDE; #import "D:\\Program Files\\Microsoft Office\\OFFICE12\\MSWORD.OLB" \
rename("ExitWindows","ExitWindowsEx")\
rename("FindText", "FindTextEx")using namespace Word;
#import "D:\\Program Files\\Microsoft Office\\Office12\\MSPPT.OLB"\
rename(_T("RGB"), _T("VisioRGB"))\
//rename("Application","ppt_Application")
using namespace PowerPoint;
#import "D:\\Program Files\\Microsoft Office\\OFFICE12\\EXCEL.EXE" \
rename(_T("DialogBox"), _T("ExcelDialogBox") ) \
rename( _T("RGB"), _T("ExcelRGB") ) \
rename( _T("CopyFile"), _T("ExcelCopyFile") ) \
rename( _T("ReplaceText"), _T("ExcelReplaceText") )\
exclude( "IFont", "IPicture" ) no_dual_interfaces
报错为:
非常多类似的错误
error C2872: “ColorFormat”: 不明确的符号
msppt.tlh(1151) : PowerPoint::ColorFormat”
msword.tlh(17730) : Word::ColorFormat”
“Window”: 不明确的符号
1> 可能是“f:\mycode\judgeencrypt\bisencrypt\bisencrypt\debug\msword.tlh(25303) : Word::Window”
1> 或 “f:\mycode\judgeencrypt\bisencrypt\bisencrypt\debug\vbe6ext.tlh(700) : VBIDE::Window”
1>f:\mycode\judgeencrypt\bisencrypt\bisencrypt\stdafx.h(57): error C2872: “Window”: 不明确的符号
1> 可能是“f:\mycode\judgeencrypt\bisencrypt\bisencrypt\debug\msword.tlh(25303) : Word::Window”
1> 或 “f:\mycode\judgeencrypt\bisencrypt\bisencrypt\debug\vbe6ext.tlh(700) : VBIDE::Window”
急等解释...
解决方案 »
- 2个窗体或是进程间传递数据怎么比较好?
- 急!急!急!请问二维小波变换图像融合算法是什么意思???最好能加以注释下 高手请进
- 家产,求VC++仿XP左侧下拉菜单编程。
- ODBC编程中用CRecordset类怎么实现查看上一条,下一条记录?
- sos!关于二叉树的遍历的问题555555555555
- 有什么好的方法判断一个文件正在被占用?
- 请问怎样知道自己程序的某个DLL是否已经加载?
- VOX类型的文件用什么软件打开?
- 如果把字符串转换成整数呢
- 进程外组件中如何传递自定义数据类型!急!急!急!
- 拖动分割条时,如何让视图及时的刷新? 而不是等到鼠标松开.
- mfc开发WindowsMediaPlayer播放列表如何与列表框实时同步,显示正在播放,请大神赐教!
去掉using namespace ....
using namespace VBIDE;
using namespace Word;
using namespace PowerPoint;
这些不都是么