This project has moved. For the latest updates, please go here.

Avoiding Cut and Copy in MS Project

Jul 1, 2016 at 6:28 PM
Hi,

I'm new at NetOffice and I may need some guidance in order to know all the possibilities given by NetOffice.

I basically need to disable, programmatically through a C# application, the features of saving, printing, cut and copy of an project file (mpp). Saving and printing I'm able to disable using interop events, but for cut and copy I wasn't. This is why I'm searching here a way to do this, in fact, I don't know if this is possible through NetOffice api for Project. Using the regular Microsoft interop for Project, I'm pretty sure that this is not possible, unlike Excel interop, for example, which provide us some features to disable cut and copy programmatically.

May some one know if I can do this through NetOffice and, beyond that, kindly provide some guidance?

Thanks in advance!
Coordinator
Jul 1, 2016 at 10:46 PM
sry, i have absolutly no idea what you talking about -.- (it is my medium english or my missing MS Project experience)
" I'm able to disable using interop events" - i do not understand that
what ist your mission in your code?

You want to prevent documents from copy/save/printing as a kind of content protection/drm right?
(It is possible to disable any general copy/paste and the special office clipboard within a message filter)


Please explain me the problem in a more technical way.

*Sebastian

(Signature: i don want Google on Codplex for captchas)
Jul 2, 2016 at 5:41 AM
Hi Sebastian,

Thanks for your answer.

Yes, I need to protect the contents of files from copy.

I'm able to protect the file only avoiding the user to print and save. I did this using events Application.ProjectBeforePrint and Application.ProjectBeforeSave. For cut and copy, I didn't find any event, method or property I can use to disable these functionalities in MS Project.

Thanks in advance!
Coordinator
Jul 3, 2016 at 1:50 PM
Hey men,

The public automation API from MSProject is not ready to handle that.
You have 2 options:

1) Implementing a message filter trough the IMessageFilter interface

2) Subclassing the MSProject main window

Both options use the same strategy: suspend the signal/message from the user interface to the application that an operation is requested.
This need some kind of research to indendify the target messages you want to suspend. Spy++ is a nice tool to help you here. (I suggest you to use subclassing in an addin)

*Sebastian

(if didnt know your expericene level, if you need a short explaination what Subclassing is, please let me know)