#imports for MS Office2013
-
Hi All, I have a wrapper class for the MS Office Products, last time I built it was way back for Office 2000. I had a set of #imports for that version, but looking in the various directories seem to have changed a bit. This is what I currently use, has anyone got an updated list for MS Office 2013? Thanks,
#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","_ExitWindows")
//#import "C:\Program Files\Microsoft Office\Office\EXCEL9.OLB" rename("DialogBox","_DialogBox") \
// rename("RGB","_RGB") \
// exclude("IFont","IPicture")
//#import "C:\Program Files\Common Files\Microsoft Shared\DAO\DAO360.DLL" rename("EOF","EndOfFile")\
// rename("BOF","BegOfFile")
//#import "C:\Program Files\Microsoft Office\Office\MSACC9.OLB" -
Hi All, I have a wrapper class for the MS Office Products, last time I built it was way back for Office 2000. I had a set of #imports for that version, but looking in the various directories seem to have changed a bit. This is what I currently use, has anyone got an updated list for MS Office 2013? Thanks,
#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","_ExitWindows")
//#import "C:\Program Files\Microsoft Office\Office\EXCEL9.OLB" rename("DialogBox","_DialogBox") \
// rename("RGB","_RGB") \
// exclude("IFont","IPicture")
//#import "C:\Program Files\Common Files\Microsoft Shared\DAO\DAO360.DLL" rename("EOF","EndOfFile")\
// rename("BOF","BegOfFile")
//#import "C:\Program Files\Microsoft Office\Office\MSACC9.OLB"I think if you generate files from a tlb the paths should automatically come up. This is of Office 2010 #import "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE12\\MSO.DLL" no_namespace A suggestion : Having developed several Office addins, and if you are also doing so, I shall strongly suggest you to use C# .
-
I think if you generate files from a tlb the paths should automatically come up. This is of Office 2010 #import "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE12\\MSO.DLL" no_namespace A suggestion : Having developed several Office addins, and if you are also doing so, I shall strongly suggest you to use C# .
Hi Sujayg, I am trying to create a *.lib file to wrap some of the Word Automation Functions. So, tell me if I got this all wrong... I created a Win32 project, selecting MFC and Static Library. I used Add Class -> MFC Class From Typelib and selected File and used C:\\Program Files\\Microsoft Office\\Office15\\MSWORD.OLB As I did not know which classes I would need, I just selected them all. So it generated a lot of Class Header files. I selected a few Header files for the classes I needed and added #includes for them. The build created the msword.tlh file etc. It also gave me over 100 errors, all due to missing items in the msword.tlh file. In the Add Class step, should I just be selecting the MSWord classes I need, and not just all of them? Or have I got this whole thing wrong? It worked OK back in the days of Office 97 and 2000. BTW, at this stage learning C# is not really an option. Thanks, Bryan.
-
Hi Sujayg, I am trying to create a *.lib file to wrap some of the Word Automation Functions. So, tell me if I got this all wrong... I created a Win32 project, selecting MFC and Static Library. I used Add Class -> MFC Class From Typelib and selected File and used C:\\Program Files\\Microsoft Office\\Office15\\MSWORD.OLB As I did not know which classes I would need, I just selected them all. So it generated a lot of Class Header files. I selected a few Header files for the classes I needed and added #includes for them. The build created the msword.tlh file etc. It also gave me over 100 errors, all due to missing items in the msword.tlh file. In the Add Class step, should I just be selecting the MSWord classes I need, and not just all of them? Or have I got this whole thing wrong? It worked OK back in the days of Office 97 and 2000. BTW, at this stage learning C# is not really an option. Thanks, Bryan.
The steps are correct and it worked fine in Office 2000. I had worked on Word automation in C++ / Office 2000 . Yes, I could reproduce the errors. Probably we need to make some changes, for working on C++ / Office. Have a look at [^] ; the steps in which the author makes a change to import. Also check the Word automation using C++ [^] - specially the Solution1.h/cpp and Solution1.h/cpp to view how imports are changed. Let us know if it helps. Sujay
-
The steps are correct and it worked fine in Office 2000. I had worked on Word automation in C++ / Office 2000 . Yes, I could reproduce the errors. Probably we need to make some changes, for working on C++ / Office. Have a look at [^] ; the steps in which the author makes a change to import. Also check the Word automation using C++ [^] - specially the Solution1.h/cpp and Solution1.h/cpp to view how imports are changed. Let us know if it helps. Sujay
Hi Sujay, Thanks for your invaluable information. Interestingly, this link http://blogs.msdn.com/b/vsod/archive/2013/06/05/office-automation-through-vc-using-mfc-class-from-typelib-results-into-large-number-of-compilation-errors.aspx has a somewhat different approach. So basically, we do no imports and just use the generated *.h files. I am in the middle of trying it, but will not be able to do more until next week. Bryan.
-
Hi Sujay, Thanks for your invaluable information. Interestingly, this link http://blogs.msdn.com/b/vsod/archive/2013/06/05/office-automation-through-vc-using-mfc-class-from-typelib-results-into-large-number-of-compilation-errors.aspx has a somewhat different approach. So basically, we do no imports and just use the generated *.h files. I am in the middle of trying it, but will not be able to do more until next week. Bryan.