New Post: Converting Interop object to NetOffice Object
Commented Unassigned: How can I initialize NetOffice.WordApi objects using a Microsoft.Office.Interop objects? [22069]
Comments: ** Comment from web user: AndreasWaning **
I have the same Problem. Could you give me sign, if I find a solution ?
> a.waning (at) gmx.de
Thanks Andreas
Commented Unassigned: How can I initialize NetOffice.WordApi objects using a Microsoft.Office.Interop objects? [22069]
Comments: ** Comment from web user: SebastianDotNet **
In NetOffice 1.7.3 you have to use the ctor from the corresponding wrapper class.
The following examples used a non-existing method called "CreateObject" which is the same like the VB6 well-known method to create a new COM class trough late-binding.
example1 - Word Application
object interopProxy = CreateObject("Word.Application");
NetOffice.WordApi.Application app = new NetOffice.WordApi.Application(null, interopProxy);
example2 - Word Document
object interopProxy = CreateObject("Word.Document);
NetOffice.WordApi.Document document = new NetOffice.WordApi.Document(null, interopProxy);
may nice to know:
I've been created some static methods in NetOffice 1.7.4 to do this easier because its a common problem for beginners. Its something like:
var managedNetOfficeWrapper = COMObject.CreateInstanceFromProxy(interopProxy);
// netoffice analyze the proxy and creates the corresponding wrapper automaticaly - you have to cast the result from the common base class COMObject to its actual type.
moreover: as far i remember, the NO 1.7.3 includes a tutorial how to face this challenge. you may give'em a try ;) ( i know, the most open-source projects doesnt spend a good explanation/documentation. I alyways try to do this better like a commercial/professional project. Its need the same time as the development - please do me pleasure and spend 5-10 minutes for the tutorials)
"The tutorials are sufficient to understand what makes NetOffice tick. Great info!"
- a customer feedback from a United States company
*Sebastian
New Post: Newbie Question - Project Templates For VS Community 2015
New Post: Newbie Question - Project Templates For VS Community 2015
i didnt find a question or i'm blind :o
2 years ago i've been created a visual extension to put some project templates and wizards to visual studio.
BUT only few people have using it and is very expensive to develope and support them(also for multiple visual studio version). for this reason - i drop them
to save time and energy for the toolbox project wizard. if you want to use VS 2015, please use VS210 Express as option in the wizard because its full compatible.
(and make sure set the option "Use NetOffice Tool" because its more familar to VSTO)
*Sebastian
Commented Unassigned: NullReferenceException on ExcelApi.Application.GetActiveInstances() [22037]
calling
```
ExcelApi.Application.GetActiveInstances()
```
with an open Excel instance which has no workbooks visibly opened (i.e. start excel and close or hide the default workbook) causes a NullReferenceException.
I tracked it down to the excel hot fix in GetActiveProxiesFromROT and the subsequent proxy lookup by hWnd.
If no workbook is visible there seems to be no EXCEL7 window and the lookup returns a null reference, which then causes the NullReferenceException on COMObject instantiation.
Best regards,
Andreas
Comments: ** Comment from web user: SebastianDotNet **
thanks for the notification. the main problem behind is: you can see all COM instance in ROT but only the first is accessible. This is why GetActiveObject in VB6/VBA has the same problem. You can't decide which instance you want and i've been implemented the hotfix.
Is it NetOffice 1.7.3 ?
I want change the implementation this weekend.
*Sebastian
Commented Unassigned: Extracolors property is not IENumerable in powerpoint 2007 [22035]
I noticed (thorugh add-in failing) that in powerpoint 2007 the extracolors object does not act like a "real" collection, that is it does not implement the IEnumerable methods.
In effect it's impossible to iterate over the collection with foreach, instead one must use a for loop with own counter. Doing the latter is not a problem as such, but one could consider whereever the NetOffice proxy type should reflect this (i.e. be something else than a collection?)
Comments: ** Comment from web user: SebastianDotNet **
I'm currently figure out whats the problem. is it a collection in VBA or interop ???
*sry powerpoint content and development targets in netoffice is a bit slower from the flagships(excel, word, outlook) because we dont have enough users here. (please keep in your mind, its an open source project and i do all this in my free time)
what i can say is: NetOffice spend a 1:1 and better inferface to the inerop assemblies(also PowerPoint)
but if its possible i want make the extracolors to an IEnumerable<T> of course.
(This is not easy - because i have to veryfiy this alwas these type - otherwise i can't do this)
*Sebastian
New Post: Newbie Question - Project Templates For VS Community 2015
New Post: Possible to Customize Quick Access Toolbar?
<?xml version="1.0" encoding="UTF-8"?>
<mso:customUI xmlns:mso="http://schemas.microsoft.com/office/2006/01/customui" xmlns:doc="http://schemas.microsoft.com/office/2006/01/customui/currentDocument">
<mso:ribbon>
<mso:qat>
<mso:documentControls>
<mso:control idQ="doc:LabOnBt" visible="true" />
<mso:control idQ="doc:OfficeOnBt" visible="true" />
</mso:documentControls>
</mso:qat>
</mso:ribbon>
</mso:customUI>
It would be great if QAT customization was possible. If not, I could use the task pane to accomplish a one click solution.Commented Unassigned: NullReferenceException on ExcelApi.Application.GetActiveInstances() [22037]
calling
```
ExcelApi.Application.GetActiveInstances()
```
with an open Excel instance which has no workbooks visibly opened (i.e. start excel and close or hide the default workbook) causes a NullReferenceException.
I tracked it down to the excel hot fix in GetActiveProxiesFromROT and the subsequent proxy lookup by hWnd.
If no workbook is visible there seems to be no EXCEL7 window and the lookup returns a null reference, which then causes the NullReferenceException on COMObject instantiation.
Best regards,
Andreas
Comments: ** Comment from web user: SebastianDotNet **
BTW: do you have a stack trace, exception details(error code line number, etc.) for me?
Its more safe to pin point the (real)problem once and for all.
*Sebastian
New Post: How to Get Breakpoints Working?
I cleaned the project and built it again. I checked the debug properties and everything appears right, at least to me. I set breakpoints on other lines and nothing works.
Any suggestions are appreciated.
New Post: How to Get Breakpoints Working?
This is an Winword.exe.config example content for targeting .Net framework version 2.
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>
(This is not a NetOffice specific behavior)
*Sebastian
New Post: How to Get Breakpoints Working?
Updated Wiki: Documentation
Why NetOffice? english |deutsch|русский
The usual methods for accessing Microsoft Office. NET are the Primary InteropAssemblies and VSTO. Both access methods involve various disadvantages.
- They are limited to a version, i.e. they only work with one or certain versions of Office
- They cause problems while transferring or installation on other systems
- They offer no protection mechanism in the management of COM proxies
NetOffice eliminates these disadvantages and remains a 1:1 wrapper that is syntactically and semantically identical to the interop assemblies.
How does NetOffice work?
NetOffice used to access only LateBinding Calls via COM Interop, but without sacrificing the convenience and simplicity of
EarlyBind calls. The slim architecture and efficient design makes this only slightly slower than so-called EarlyBind calls in .NET (max. 10%). Events in NetOffice are implemented with a technique
the author calls Dynamic EarlyBinding. Learn more about this in the
technical documentation.
NetOffice contains 16 assemblies. Why and which assemblies do I need for my desired Office application?
All Office applications use types which are defined in other components/type libraries. These dependent type libraries are therefore
given as an independent assembly. Each assembly also requires the
NetOffice.dll assembly. An overview which Office application integrates which additional assemblies can be found here.
Deployment Table:
Office applications | Dependencies |
ExcelApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll | |
WordApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll | |
OutlookApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll | |
PowerPointApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll | |
AccessApi.dll | |
OfficeApi.dll | |
DAOApi.dll | |
VBIDEApi.dll | |
ADODBApi.dll | |
OWC10Api.dll | |
MSDATASRCApi.dll | |
MSComctlLibApi.dll | |
NetOffice.dll | |
MSProjectApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
MSHTMLApi.dll | |
NetOffice.dll | |
VisioApi.dll | |
VisioApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll |
What do I have to do to deliver my application with NetOffice?
Nothing except copying the needed assemblies to the target system. You don't need a registration or something like that with the exception of COMAddIns. Managed COMAddins generally have to be registered via the .Net Utility RegAsm.exe or the Windows Installer
do that or you.
Do COMAddins also work version independent?
Yes, of course. This is a particular strength of NetOffice. See the code examples for example project for all Office applications but you have to create 2 Addins for 32/64 Bit support.
Is NetOffice ready for multiple platforms(32/64 Bit)?
You can use the NetOffice AnyCPU assemblies in all scenarios. his is true regardless wether you develop for a 32Bit Office application or a 64Bit Office application, even independent on which platform these are installed. If your assembly is a standalone
application (.exe) or is being loaded by one, you can compile your assembly as AnyCPU without worries.
If your assembly is a COMAddin that is being loaded by a 32Bit Office application, you can still compile it as AnyCPU. If you develop a COMAddin that is being used by a 64Bit Office application, you have to compile your assembly as x64. If you wart to
support 32Bit and 64Bit Office applications, you may need to provide a second x64-compiled COMAddin. This behaviour is the same in all scenarios(interop,vsto or netoffice). A 64Bit application can only load 64Bit Dll's.If you use a 64Bit Office for testing
on your development system and you want to register your COMAddin while compiling (Register for COM Interop), you need to keep in mind that some older versions of Visual Studio call the 32Bit registration in that case. In this case, you get the following error:
"File <path to assembly> is not a valid assembly".
You can read a workarround by Microsoft here:
http://support.microsoft.com/kb/956933
How do I migrate my solution to NetOffice?
Interop Solutions: Change the references and the using(imports in vb) statements. Occasionally, you need to make some adjustments to event triggers. You have to replace all Marshall.ReleaseComObject calls with
Dispose. you can also delete the most ReleaseComObject calls because NetOffice manages COM proxies for you. Read more about in the technical documentation:Understanding COM Proxy Management
VBA Solutions: Developers there want changing a VBA solution to VB.NET and NetOffice has to know that VB.NET is syntactical similar to VBA but has also some different concepts. If you have good VB.NET skills then
you have no problems to migrate your solution to NetOffice.
COM proxy management
If you call Office applications (COM servers) .NET returns instead of real objects so-called COM proxies. In order to signal the COM server that you no longer need this, you have to free it with a
special method. This applies to VSTO as well as to interop assemblies.
Due to this fact, you must not use no objects implicitly or use Enumerator directly because it then can no longer be released. In NetOffice each object provides the method Dispose() for when you do not need it anymore. All classes in NetOffice implement
the IDisposable interface and also provide the Dispose() method. However, you do not have to call Dispose() for every used object and you may also use objects implicitly and Enumerator directly without having to worry about releasing
ti afterwards. NetOffice generated proxies stored in a separate table and frees when you request it or a parent object is being released. More on that in the
technical documentation and
Tutorial01.
Unknown and Variant Types
Many office applications include Properties, return values or parameter whose type is not known at design time and which can change at run time, depending on context.
There is a difference between unknown COM proxies and the variant data type which has its roots in the Visual Basic for Applications (VBA).
Unknown COM proxies in NetOffice have the type COMObject. Each class in NetOffice also inherits from this type. The declaration of unkown proxies isObject since NetOffice 1.5.1 as special service for VB developers to use the integrated late binding feature. You can also convert an anonymous COM proxy at run-time into the actual type without problems.
The variant data type is used in VBA for any type to accept both a COM proxy and a scalar data type such as bool or int. In NetOffice that type is replaced by the type object. If a Variant Property is a COM proxy at run time you get an object of the
corresponding NetOffice wrapper class, otherwise the the corresponding scalar data type.More on that in thetechnical documentation andTutorial06.
If NetOffice supports all versions of Office, how do I know which Office version offerswhich functionality?
All classes, properties, methods, enums, etc. come with XML Documentation and have a special attribute that identifies which office version(s)
this entity support. You get this information displayed during development also through IntelliSense. Moreover, it is possible to examine an assembly (created with NetOffice) withNetOffice.DeveloperToolbox which Office versions are used practically. Use this opportunity before shipping your assembly to make sure that your program works with the
Office versions that you (or your customers) have specified.
Screenshot: IntelliSense support in C # for version information of a property.
Updated Wiki: Documentation
Why NetOffice? english |deutsch|русский
The usual methods for accessing Microsoft Office. NET are the Primary InteropAssemblies and VSTO. Both access methods involve various disadvantages.
- They are limited to a version, i.e. they only work with one or certain versions of Office
- They cause problems while transferring or installation on other systems
- They offer no protection mechanism in the management of COM proxies
NetOffice eliminates these disadvantages and remains a 1:1 wrapper that is syntactically and semantically identical to the interop assemblies.
How does NetOffice work?
NetOffice used to access only LateBinding Calls via COM Interop, but without sacrificing the convenience and simplicity of
EarlyBind calls. The slim architecture and efficient design makes this only slightly slower than so-called EarlyBind calls in .NET (max. 10%). Events in NetOffice are implemented with a technique
the author calls Dynamic EarlyBinding. Learn more about this in the
technical documentation.
NetOffice contains 16 assemblies. Why and which assemblies do I need for my desired Office application?
All Office applications use types which are defined in other components/type libraries. These dependent type libraries are therefore
given as an independent assembly. Each assembly also requires the
NetOffice.dll assembly. An overview which Office application integrates which additional assemblies can be found here.
Deployment Table:
Office applications | Dependencies |
ExcelApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll | |
WordApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll | |
OutlookApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll | |
PowerPointApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll | |
AccessApi.dll | |
OfficeApi.dll | |
DAOApi.dll | |
VBIDEApi.dll | |
ADODBApi.dll | |
OWC10Api.dll | |
MSDATASRCApi.dll | |
MSComctlLibApi.dll | |
NetOffice.dll | |
MSProjectApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
MSHTMLApi.dll | |
NetOffice.dll | |
VisioApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll | |
MSFormsApi.dll | |
VisioApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll |
What do I have to do to deliver my application with NetOffice?
Nothing except copying the needed assemblies to the target system. You don't need a registration or something like that with the exception of COMAddIns. Managed COMAddins generally have to be registered via the .Net Utility RegAsm.exe or the Windows Installer
do that or you.
Do COMAddins also work version independent?
Yes, of course. This is a particular strength of NetOffice. See the code examples for example project for all Office applications but you have to create 2 Addins for 32/64 Bit support.
Is NetOffice ready for multiple platforms(32/64 Bit)?
You can use the NetOffice AnyCPU assemblies in all scenarios. his is true regardless wether you develop for a 32Bit Office application or a 64Bit Office application, even independent on which platform these are installed. If your assembly is a standalone
application (.exe) or is being loaded by one, you can compile your assembly as AnyCPU without worries.
If your assembly is a COMAddin that is being loaded by a 32Bit Office application, you can still compile it as AnyCPU. If you develop a COMAddin that is being used by a 64Bit Office application, you have to compile your assembly as x64. If you wart to
support 32Bit and 64Bit Office applications, you may need to provide a second x64-compiled COMAddin. This behaviour is the same in all scenarios(interop,vsto or netoffice). A 64Bit application can only load 64Bit Dll's.If you use a 64Bit Office for testing
on your development system and you want to register your COMAddin while compiling (Register for COM Interop), you need to keep in mind that some older versions of Visual Studio call the 32Bit registration in that case. In this case, you get the following error:
"File <path to assembly> is not a valid assembly".
You can read a workarround by Microsoft here:
http://support.microsoft.com/kb/956933
How do I migrate my solution to NetOffice?
Interop Solutions: Change the references and the using(imports in vb) statements. Occasionally, you need to make some adjustments to event triggers. You have to replace all Marshall.ReleaseComObject calls with
Dispose. you can also delete the most ReleaseComObject calls because NetOffice manages COM proxies for you. Read more about in the technical documentation:Understanding COM Proxy Management
VBA Solutions: Developers there want changing a VBA solution to VB.NET and NetOffice has to know that VB.NET is syntactical similar to VBA but has also some different concepts. If you have good VB.NET skills then
you have no problems to migrate your solution to NetOffice.
COM proxy management
If you call Office applications (COM servers) .NET returns instead of real objects so-called COM proxies. In order to signal the COM server that you no longer need this, you have to free it with a
special method. This applies to VSTO as well as to interop assemblies.
Due to this fact, you must not use no objects implicitly or use Enumerator directly because it then can no longer be released. In NetOffice each object provides the method Dispose() for when you do not need it anymore. All classes in NetOffice implement
the IDisposable interface and also provide the Dispose() method. However, you do not have to call Dispose() for every used object and you may also use objects implicitly and Enumerator directly without having to worry about releasing
ti afterwards. NetOffice generated proxies stored in a separate table and frees when you request it or a parent object is being released. More on that in the
technical documentation and
Tutorial01.
Unknown and Variant Types
Many office applications include Properties, return values or parameter whose type is not known at design time and which can change at run time, depending on context.
There is a difference between unknown COM proxies and the variant data type which has its roots in the Visual Basic for Applications (VBA).
Unknown COM proxies in NetOffice have the type COMObject. Each class in NetOffice also inherits from this type. The declaration of unkown proxies isObject since NetOffice 1.5.1 as special service for VB developers to use the integrated late binding feature. You can also convert an anonymous COM proxy at run-time into the actual type without problems.
The variant data type is used in VBA for any type to accept both a COM proxy and a scalar data type such as bool or int. In NetOffice that type is replaced by the type object. If a Variant Property is a COM proxy at run time you get an object of the
corresponding NetOffice wrapper class, otherwise the the corresponding scalar data type.More on that in thetechnical documentation andTutorial06.
If NetOffice supports all versions of Office, how do I know which Office version offerswhich functionality?
All classes, properties, methods, enums, etc. come with XML Documentation and have a special attribute that identifies which office version(s)
this entity support. You get this information displayed during development also through IntelliSense. Moreover, it is possible to examine an assembly (created with NetOffice) withNetOffice.DeveloperToolbox which Office versions are used practically. Use this opportunity before shipping your assembly to make sure that your program works with the
Office versions that you (or your customers) have specified.
Screenshot: IntelliSense support in C # for version information of a property.
Updated Wiki: Documentation
Why NetOffice? english |deutsch|русский
The usual methods for accessing Microsoft Office. NET are the Primary InteropAssemblies and VSTO. Both access methods involve various disadvantages.
- They are limited to a version, i.e. they only work with one or certain versions of Office
- They cause problems while transferring or installation on other systems
- They offer no protection mechanism in the management of COM proxies
NetOffice eliminates these disadvantages and remains a 1:1 wrapper that is syntactically and semantically identical to the interop assemblies.
How does NetOffice work?
NetOffice used to access only LateBinding Calls via COM Interop, but without sacrificing the convenience and simplicity of
EarlyBind calls. The slim architecture and efficient design makes this only slightly slower than so-called EarlyBind calls in .NET (max. 10%). Events in NetOffice are implemented with a technique
the author calls Dynamic EarlyBinding. Learn more about this in the
technical documentation.
NetOffice contains a number of assemblies. Why and which assemblies do I need for my desired Office application?
All Office applications use types which are defined in other components/type libraries. These dependent type libraries are therefore
given as an independent assembly. Each assembly also requires the
NetOffice.dll assembly. An overview which Office application integrates which additional assemblies can be found here.
Deployment Table:
Office applications | Dependencies |
ExcelApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll | |
WordApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll | |
OutlookApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll | |
PowerPointApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll | |
AccessApi.dll | |
OfficeApi.dll | |
DAOApi.dll | |
VBIDEApi.dll | |
ADODBApi.dll | |
OWC10Api.dll | |
MSDATASRCApi.dll | |
MSComctlLibApi.dll | |
NetOffice.dll | |
MSProjectApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
MSHTMLApi.dll | |
NetOffice.dll | |
VisioApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll | |
MSFormsApi.dll | |
VisioApi.dll | |
OfficeApi.dll | |
VBIDEApi.dll | |
NetOffice.dll |
What do I have to do to deliver my application with NetOffice?
Nothing except copying the needed assemblies to the target system. You don't need a registration or something like that with the exception of COMAddIns. Managed COMAddins generally have to be registered via the .Net Utility RegAsm.exe or the Windows Installer
do that or you.
Do COMAddins also work version independent?
Yes, of course. This is a particular strength of NetOffice. See the code examples for example project for all Office applications but you have to create 2 Addins for 32/64 Bit support.
Is NetOffice ready for multiple platforms (32/64 Bit)?
You can use the NetOffice AnyCPU assemblies in all scenarios. his is true regardless wether you develop for a 32Bit Office application or a 64Bit Office application, even independent on which platform these are installed. If your assembly is a standalone
application (.exe) or is being loaded by one, you can compile your assembly as AnyCPU without worries.
If your assembly is a COMAddin that is being loaded by a 32Bit Office application, you can still compile it as AnyCPU. If you develop a COMAddin that is being used by a 64Bit Office application, you have to compile your assembly as x64. If you wart to support
32Bit and 64Bit Office applications, you may need to provide a second x64-compiled COMAddin. This behaviour is the same in all scenarios(interop,vsto or netoffice). A 64Bit application can only load 64Bit Dll's.If you use a 64Bit Office for testing on your
development system and you want to register your COMAddin while compiling (Register for COM Interop), you need to keep in mind that some older versions of Visual Studio call the 32Bit registration in that case. In this case, you get the following error:
"File <path to assembly> is not a valid assembly".
You can read a workarround by Microsoft here:
http://support.microsoft.com/kb/956933
How do I migrate my solution to NetOffice?
Interop Solutions: Change the references and the using(imports in vb) statements. Occasionally, you need to make some adjustments to event triggers. You have to replace all Marshall.ReleaseComObject calls with
Dispose. you can also delete the most ReleaseComObject calls because NetOffice manages COM proxies for you. Read more about in the technical documentation:Understanding COM Proxy Management
VBA Solutions: Developers there want changing a VBA solution to VB.NET and NetOffice has to know that VB.NET is syntactical similar to VBA but has also some different concepts. If you have good VB.NET skills then
you have no problems to migrate your solution to NetOffice.
COM proxy management
If you call Office applications (COM servers) .NET returns instead of real objects so-called COM proxies. In order to signal the COM server that you no longer need this, you have to free it with a
special method. This applies to VSTO as well as to interop assemblies.
Due to this fact, you must not use no objects implicitly or use Enumerator directly because it then can no longer be released. In NetOffice each object provides the method Dispose() for when you do not need it anymore. All classes in NetOffice implement
the IDisposable interface and also provide the Dispose() method. However, you do not have to call Dispose() for every used object and you may also use objects implicitly and Enumerator directly without having to worry about releasing
ti afterwards. NetOffice generated proxies stored in a separate table and frees when you request it or a parent object is being released. More on that in the
technical documentation and
Tutorial01.
Unknown and Variant Types
Many office applications include Properties, return values or parameter whose type is not known at design time and which can change at run time, depending on context.
There is a difference between unknown COM proxies and the variant data type which has its roots in the Visual Basic for Applications (VBA).
Unknown COM proxies in NetOffice have the type COMObject. Each class in NetOffice also inherits from this type. The declaration of unkown proxies isObject since NetOffice 1.5.1 as special service for VB developers to use the integrated late binding feature. You can also convert an anonymous COM proxy at run-time into the actual type without problems.
The variant data type is used in VBA for any type to accept both a COM proxy and a scalar data type such as bool or int. In NetOffice that type is replaced by the type object. If a Variant Property is a COM proxy at run time you get an object of the
corresponding NetOffice wrapper class, otherwise the the corresponding scalar data type.More on that in thetechnical documentation andTutorial06.
If NetOffice supports all versions of Office, how do I know which Office version offerswhich functionality?
All classes, properties, methods, enums, etc. come with XML Documentation and have a special attribute that identifies which office version(s)
this entity support. You get this information displayed during development also through IntelliSense. Moreover, it is possible to examine an assembly (created with NetOffice) withNetOffice.DeveloperToolbox which Office versions are used practically. Use this opportunity before shipping your assembly to make sure that your program works with the
Office versions that you (or your customers) have specified.
Screenshot: IntelliSense support in C # for version information of a property.
Updated Wiki: Home
english | deutsch | russian
.NET Wrapper Assemblies for accessing the following MS Office applications:
- Office, Excel, Word, Outlook, PowerPoint, Access, Project, Visio
Features
- Office integration without version limitations
- All features of the Office versions 2000, 2002, 2003, 2007, 2010, 2013 are included
- Active support in version independent development (please scroll down)
- Syntactically and semantically identical to the Microsoft Interop Assemblies
- No training if you already know the Office object model, use your existing PIA code
- Reduced and more readable code with automatic management of COM proxies
- Usable with .NET version 2.0 or higher
- Easy Addin Development
- No deployment hurdles, no registration
- No dependencies, no interop assemblies, no need for VSTO
- Visual Studio Project Templates and Wizards availablePhoto Gallery
Visual Basic and C# Example Code Online
1 | Tutorials currently under construction for Release 1.5 |
2 | Excel |
3 | Word |
4 | Outlook |
5 | PowerPoint |
6 | Access |
7 | Misc |
An indispensablehelper
TheNetOffice Developer Toolbox helps you. | |
Active support in version independent developement
Documentation and FAQ
Technical Documentation and Resources
1 | Technical Documentation (Reference, Performance) under construction |
2 | Technical FAQ |
3 | NetOffice.DeveloperToolbox |
4 | Visual Studio Project Wizard |
Roadmap
1 | NetOffice.DeveloperToolbox Done! |
2 | Extended Linq Support |
3 | Support Microsoft Exchange, Microsoft Visio, Microsoft Project completly |
4 | Enumerators for collections without native enumerator support Done! |
5 | Additional overloads for methods with optional parameters Done! |
6 | FxCop approved Sourcecode |
7 | Visual UI designer |
Questions or Comments?
1 | |
2 | Disscusion Board |
3 | Sebastians Blog about NetOffice |
Stay informed | Follow NetOffice on Twitter for actual infos about updates and issues |
New Post: Deploy NetOffice Word COM Addin
[Setup]
AppName=TripNO
AppVerName=v1.0
DefaultDirName={pf}\TripNO
DefaultGroupName=TripNO
UninstallDisplayIcon={app}\TripNO
OutputDir=setup
OutputBaseFilename=TripNO_v1.0_setup
[Code]
[Tasks]
;Name: "desktopicon"; Description: "Create a &desktop TripNO icon"; GroupDescription: "Additional icons:"; Flags: unchecked
;Name: "quicklaunchicon"; Description: "Create a &Quick Launch TripNO icon"; GroupDescription: "Additional icons:"; Flags: unchecked
[Files]
Source: "bin\Debug\NetOffice.dll"; DestDir: "{app}";
Source: "bin\Debug\NetOffice.xml"; DestDir: "{app}";
Source: "bin\Debug\OfficeApi.dll"; DestDir: "{app}";
Source: "bin\Debug\OfficeApi.xml"; DestDir: "{app}";
Source: "bin\Debug\stdole.dll"; DestDir: "{app}";
Source: "bin\Debug\Trip.dll"; DestDir: "{app}";
Source: "bin\Debug\Trip.pdb"; DestDir: "{app}";
Source: "bin\Debug\Trip.tlb"; DestDir: "{app}";
Source: "bin\Debug\VBIDEApi.dll"; DestDir: "{app}";
Source: "bin\Debug\VBIDEApi.xml"; DestDir: "{app}";
Source: "bin\Debug\WordApi.dll"; DestDir: "{app}";
Source: "bin\Debug\WordApi.xml"; DestDir: "{app}";
;Source: "tripNO.ico"; DestDir: "{app}";
[Run]
;Unregister
Filename: """C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe"" ""{app}\Trip.dll"" /tlb:Trip.tlb /codebase /u";
;Register
Filename: """C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe"" ""{app}\Trip.dll"" /tlb:Trip.tlb /codebase";
[Registry]
[Icons]
;Name: "{group}\TripNO"; Filename: "{pf}\Microsoft Office\OFFICE14\winword.exe"; Check: FileExists(ExpandConstant('{pf}\Microsoft Office\OFFICE14\winword.exe')); IconFilename: "{app}\tripNO.ico"
;Name: "{commondesktop}\TripNO"; Filename: "{pf}\Microsoft Office\OFFICE14\winword.exe"; Check: FileExists(ExpandConstant('{pf}\Microsoft Office\OFFICE14\winword.exe')); IconFilename: "{app}\tripNO.ico"; Tasks: desktopicon
;Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\TripNO"; Filename: "{pf}\Microsoft Office\OFFICE14\winword.exe"; Check: FileExists(ExpandConstant('{pf}\Microsoft Office\OFFICE14\winword.exe')); IconFilename: "{app}\tripNO.ico"; Tasks: quicklaunchicon
New Post: SPREEDSHEET IN BROWSER
Can I use NetOffice - MS Office to show, edit and save a spreedshet in browser like Google Drive? Where can I find a example or a howto?