#import of msword.olb into my C++ application but I'm getting lots of errors
to do with VBE
Where do I find the import for VBE ?
Thanks
--
Michael Tissington
Oaklodge Technologies
http://www.oaklodge.com/technology
In article <uWT4h2LmCHA.1740@tkmsftngp07>, Michael Tissington says...
Q301321 - PRB: #import Automation Fails With Two Office Versions Installed
http://support.microsoft.com/support/kb/articles/q301/3/21.asp
Here are the #import samples
///////////// begin
// uncomment the line indicate the version of Office which you wish to build
// #define _OFFICE_XP
// #define _OFFICE_2K
// #define _OFFICE_97
// Import typelib for building application with Micsosoft Office (all
version)
// the path is vary, depend on where you install Office
#ifdef _OFFICE_XP
///////////////////////////////////////////////////////////////////////
// Word XP
#import "C:\PROGRAM FILES\COMMON FILES\MICROSOFT SHARED\OFFICE10\MSO.DLL"
#import "C:\Program Files\Common Files\Microsoft
Shared\VBA\VBA6\VBE6EXT.OLB" #import "D:\PROGRAM FILES\MICROSOFT
OFFICE\OFFICE10\MSWORD.OLB" \
rename("ExitWindows","MsoExitWindows")
// Excel XP
#import "D:\Program Files\Microsoft Office\Office10\EXCEL.EXE" \
rename("DialogBox","MsoDialogBox") rename("RGB","MsoRGB")
#elif defined(_OFFICE_2K)
///////////////////////////////////////////////////////////////////////
// Word 2k
#import "C:\Program Files\Microsoft Office\Office\MSO9.DLL"
#import "C:\Program Files\Common Files\Microsoft
Shared\VBA\VBA6\VBE6EXT.OLB" #import "C:\PROGRAM FILES\MICROSOFT
OFFICE\OFFICE\MSWORD9.OLB" \
rename("ExitWindows","MsoExitWindows")
// Excel 2k
#import "C:\Program Files\Microsoft Office\Office\EXCEL9.OLB" \
rename("DialogBox","MsoDialogBox") rename("RGB","MsoRGB")
#elif defined(_OFFICE_97)
///////////////////////////////////////////////////////////////////////
// Word 97
#import "C:\Program Files\Microsoft Office\Office\MSO97.DLL"
#import "C:\Program Files\Common Files\Microsoft Shared\VBA\VBEEXT1.OLB"
#import "C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\MSWORD8.OLB" \
rename("ExitWindows","MsoExitWindows")
// Excel 97
#import "C:\Program Files\Microsoft Office\Office\EXCEL8.OLB" \
rename("DialogBox","MsoDialogBox") rename("RGB","MsoRGB")
#else
// warning for importing typelib
#error *** You have to specify a version of Microsoft Office in order build
this application successfully ***
#endif
///////////// end
Hope this works for you
Thanks!
Achint Srivastava
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.