开发者

Access or use bulit-in features of any Microsoft Application in .Net

If I want to use/access the features of Microsoft products(Say Microsoft Word Grammer Check feature) in .Net windows/web a开发者_C百科pplication, how can I achieve this? Do I need to access the corresponding DLL(or Namespace) to use the features? If so, please provide me a sample to use the feature of other Microsoft products in .Net application. Please, provide me a website which is good for this stuff.


It depends on what feature. In general if you want to use Office programs you can use Office Interop (here's an example of automating Excel from C#). Some features might have a separate API that you can call, but you'd probably want to look at the documentation for the specific feature. In general, if a feature is in a DLL and you can get hold of the function signatures you can probably call it via PInvoke (see here for an explanation of PInvoke).


MS usually bundles the features into COM libraries that can be directly referenced in .NET using the 'Add Reference'. Right-click on the project and choose 'Add Reference', then select the COM tab to see what different COM components are installed on your PC. The names are pretty descriptive. You can then add these COM components to your .NET application and use the classes inside it. Use the View >> Object Viewer to check what classes are available.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜