www.pudn.com > Excel_example.rar > StdAfx.h
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, // but are changed infrequently #if !defined(AFX_STDAFX_H__203E3EB6_84A9_45B6_A46D_09661B53761C__INCLUDED_) #define AFX_STDAFX_H__203E3EB6_84A9_45B6_A46D_09661B53761C__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #define STRICT #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0400 #endif #define _ATL_APARTMENT_THREADED #include//You may derive a class from CComModule and use it if you want to override //something, but do not change the name of _Module extern CComModule _Module; #include ///////////////////////////////////////////////////////////////////////////////// /* 导入工程所需Office2K及Excel2K类型库,其*/ /* 中路径可根据安装路径自行设定, jingzhou xu */ /******************* Office 2000下导入使用 ************************/ #import "c:\\Program Files\\Microsoft Office\\Office\\mso9.dll" rename_namespace("Office") using namespace Office; #import "c:\\Program Files\\Common Files\\Microsoft Shared\\VBA\\VBA6\\VBE6EXT.olb" rename_namespace("VBE6") using namespace VBE6; // Excel导入库 #import "c:\\Program Files\\Microsoft Office\\Office\\EXCEL9.olb" rename("RGB","RGBEx"),rename("DialogBox","DialogBoxEx"),named_guids,rename_namespace("MSExcel") using namespace MSExcel; // PowerPoint导入库 //#import "E:\\Program Files\\Microsoft Office\\Office\\MSPPT9.OLB" named_guids,rename_namespace("MSPPT") //using namespace MSPPT; // Word导入库 //#import "E:\\Program Files\\Microsoft Office\\Office\\MSWORD9.olb" rename("ExitWindows","ExitWindowsEx"),named_guids,rename_namespace("MSWord") //using namespace MSWord; /********************* Office XP下导入使用 ***********************/ //#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; ////////////////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_STDAFX_H__203E3EB6_84A9_45B6_A46D_09661B53761C__INCLUDED)