C# Word Add-in

S

S.Vidyaraman

Hi,

1. I am looking for comprehensive and authoritative information on coding
Add-in's to MS Word 2003 in C#. Specifically, I need information on using
Office IRMs (Information Rights Management ). Does anyone know of any book /
online documentation etc for this ?

2. Will I be needing Visual Studio Tools for MS Office for this ? I don't
mind buying it, but I need to know if I can code Office IRMs in it and I
cant seem to find that out.

Thanks,
S.Vidyaraman
 
S

S.Vidyaraman

Thanks for the insight. I looked at the RMS SDK. Please correct me if I am
wrong : DO we need Win 2003 Server to implement permissions and policies ?
In my C# add-in, I see functions in the Word.Document class for Permissions
which has a "useirm" parameter. I am wondering if I can do the same thing
locally with a certificate etc instead of making the irm engine authenticate
itself to passport services. My final goal is to make Office 2003
authenticate with my services so I can implement custom DRM solutions. Any
insight is appreciated.
Thanks,
S.Vidyaraman
 
S

Sue Mosher [MVP-Outlook]

You can use permissions with the public Passport RM server, but not policies. For policies, you would need the in-house RM server, which runs only on Windows 2003. The Permission object property works only with Microsoft's RM, not with other RM solutions. From Help: "Use of the Permission object raises an error when the Windows Rights Management client is not installed."
 
S

S.Vidyaraman

Thanks again. I am going ahead with a convoluted form of permissions for
now, till we get a 2003 Server (if at all we get one). I have a related
question in my C# Add-in. I am hooking events on MS Word so that I can
enforce a first level of "permissions" - say prevent copy.
1. How do I hook the copy "event" ? -- As of now I can capture Ctrl-C and
the Menu Bar -->Edit --> Copy Button click as well as the Standard --> Copy
icon click. But then, this is the button click, not the copy event itself !
My code looks like :

bar = bars["Menu Bar"];
for (int k = 1;k <= bar.accChildCount;k++)
popupBar = (CommandBarPopup)bar.Controls;
for (int j = 1; j <= popupBar_nested.accChildCount; j++)
button = (CommandBarButton)popupBar_nested.Controls[j];
button.Click +=new
_CommandBarButtonEvents_ClickEventHandler(button_Click);

2. For some reason, when I run this code on my edvelopement machine, it
works fine. But on a Fresh version on Vmware, it works the first time
around, but it doesnt work when the machine is rebooted. I have looked at
http://support.microsoft.com/?id=840585 and other related KB articles. The
Office 2003 PIAs have been installed from the installation media and I DONT
include it in my setup file, as mentioned in another KB article. Is this got
to do with some .NET permissions etc ? I cant figure out why it works the
first time around, but not when its rebooted ! BTW, the other hooks I set
using the Word interops ( like document open etc ) work just fune. Its only
the button clicks. So the Add-in does load an perform ALL other hooks
properly.

Thanks,
S.Vidyaraman
 
S

Sue Mosher [MVP-Outlook]

1) There is no Copy event. I do very little work with Word events, but suspect that the Application.WindowSelectionChange event might be useful in this regard.

2) Don't know. You might want to start a new thread to zero in on the button click issue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top