Greg Bishop
Posts: 1
Joined: 2005-06-08
|
I am interested in how to insert a field code into MS Word using Add-in Express 2 .NET Edition.
Secondarily, I will need to have the field code data relayed back to my add-in for it to be updated. For example, the field code might have be something like:
{ADDIN DEMO.ADDIN <Sample><MyParameter>MoonPhase</MyParameter></Sample>}
My add-in would then calculate the moon phase based upon the date and return text of "Full Moon", "Half Moon", etc. This is a somewhat trivial example, but I think it illustrates what I'm trying to do: (1) In code, add a field code to MS Word (say from a toolbar button being pressed) and (2) have my add-in update the value of the field code based upon the variables in the field code.
Can this be done using Add-in Express 2 .NET Edition? If so, can you point me to a brief sample (preferably in VB.NET)?
Another (unrelated) question I have is, can Add-in Express 2 .NET Edition be used with WordPerfect or any other word processor?
Thanks in advance. |
|
Sven Heitmann
Posts: 193
Joined: 2004-08-23
|
Add-in Express is only useable with Microsoft Office Products. This is, because Microsoft Office provides a plugable interface for Addins, so it can not run on Word Perfect or other Office programs.
I am not sure what you will do, however I can give you some general answer.
All things you can do with VBA can be done by managed code.
The logic is the same when using VBA and C#, you are using the same Objects and Methods, so you can reuse your code and Algorithm.
This has nothing to do with ADX.
ADX provides an easy and straight way to plug in your Addin into Office and provides some easy way to manage Office Events and all the CommandBar related thing as well as some Outlook related things (don't use it, so I can't count them)
All the other stuff is done by using the Microsoft Interop Assemblies.
They provide access to the Office Objects you can interact with.
For example you can write an application that is doing some Reports in Word.
You don't need ADX for this, but the Office Interop Assemblies.
You can create your own Word Instanccce, write the Report like you would do it with VBA (open a template an fill out some Bookmarks), print it and finally shut down you Word Instance.Best regards,
Sven Heitmann |
|
Aleksey Zhigar
Guest
|
|
Rafal Piotrowski
Guest
|
Greg Bishop wrote:
For example you can write an application that is doing some Reports in Word.
You don't need ADX for this, but the Office Interop Assemblies.
You can create your own Word Instanccce, write the Report like you would do it with VBA (open a template an fill out some Bookmarks), print it and finally shut down you Word Instance.
But what if you want that this report generation process starts from Word itself (triggered by user pressing a button on the menu bar)? Then I gues that ADX would be handy?
regards
rp |
|
Aleksey Zhigar
Guest
|
Absolutely right!
ADX perfectly suits for such kind if tasks. |
|