Google Answers Logo
View Question
Q: Microsoft Office Customization Question ( Answered 5 out of 5 stars,   1 Comment )
Subject: Microsoft Office Customization Question
Category: Computers > Programming
Asked by: jkopelman-ga
List Price: $200.00
Posted: 17 Dec 2004 11:09 PST
Expires: 16 Jan 2005 11:09 PST
Question ID: 444000
I have a question about the extensibility of Microsoft Office.
Specifically, is it technically possible through a piece of
client-side software (add-in, COM, C++ app, etc.) to customize
Microsofot Office applications (word, excel, etc) so that:

For specific documents, the user can be prevented from:


the document?

If so, how would one do it.

Request for Question Clarification by hummer-ga on 17 Dec 2004 12:17 PST
Hi jkopelman,

What version of MS Office do you have?

Thanks, hummer

Clarification of Question by jkopelman-ga on 17 Dec 2004 12:52 PST
To clarify, I'm not just looking to do this for my own desktop -- but
rather develop software application that I can market and distribute. 
This software application would preferably work in Office 97, Office
2000, Office XP, Office 2003.

Request for Question Clarification by answerguru-ga on 18 Dec 2004 00:07 PST
Hi there,

The short answer to your question is "yes", but I want to make sure
that I provide you with all the information you require. Could you
please provide further detail as to the type of information you are
interested in?

Please note that your question is more likely to be answered if you
request information about different types of integrated software
components or how Office is designed to allow for customization. A
question that is more complex to address would be along the lines of
"how do I do this" - on initial review this is a loaded question and
many hours of effort would be required to design an appropriate


Clarification of Question by jkopelman-ga on 18 Dec 2004 04:34 PST
Thanks for your response.  Let me try to clarify...

I am not looking for/expecting any code to be written.  I am just
looking for a high-level architecture or specification as to how to
make the modifications.  (ie, what functionality - COM add-in) and
what API Microsoft provides to block the functionality...

Request for Question Clarification by answerguru-ga on 19 Dec 2004 13:22 PST
Hello again,

I've had some time to think about your question further, and I have
come to the conclusion that my previous response may have been a bit
premature. While I have found ways to disable these functions, the
problem lies in the fact that you want these security measures applied
to a specific document, not the user's installed software (this would
be considered malicious).

I have found evidence online explaining why what you are asking is not
actually possible (for a determined user). From your original
question, you have left open the possibility for an answer to be "no".
Would it be sufficient to provide you with my findings as an answer? I
realize that it may not be the response you were hoping for, but it
does address your original question.

Please let me know.


Clarification of Question by jkopelman-ga on 19 Dec 2004 18:13 PST
A "no" is acceptable, if fully documented.

However, just to clarify -- I do envision a piece of software residing
on the users desktop.  The software I envision would be network aware
-- so that it would determine, via the internet, whether to disable
the features on word for a specific document.  (ie, the software
would, before opening a document, ask a server whether to disable any
of the word features).  So we SHOULD assume that there is software
resident on the computer of the document reader...

Request for Question Clarification by answerguru-ga on 19 Dec 2004 19:04 PST
Hi again,

You've peaked my curiosity (as I can't immediately understand why
anyone would willingly install such software of their own free will),
so I must ask a couple of follow-up questions:

1. Is your target user base aware of the fact that this software is
being installed and will remain activate on their computers?
2. How do you plan on convincing users to install software that has
the potential to prohibit their use of MS Word? (ie. what is the
incentive for the user to do such a thing)


Clarification of Question by jkopelman-ga on 20 Dec 2004 04:21 PST
Hi again.

Without giving away the entire business model, I can safely say that
this will not be spyware.  Users will knowingly and willfully install
the product on their computer.  It is a form of DRM/security software
which will enable creaters of documents to add additional protection
beyond the weak Microsoft Word "enter your password" layer.

Request for Question Clarification by answerguru-ga on 21 Dec 2004 00:48 PST
Is the answer to this question time-sensitive?

I would like to look into in a bit further but may not get a chance to
get back to you with a complete answer until later this week.

If you don't mind waiting, I'd still be happy to research this for you.


Clarification of Question by jkopelman-ga on 21 Dec 2004 06:15 PST
I'd like to have the answer by December 24th if at all possible...Thanks!

Request for Question Clarification by answerguru-ga on 21 Dec 2004 23:03 PST
I will try for the 24th, although it may be a day later.

Also, when you mentioned "copying", I took it to mean the ability to
copy something from within a document and paste it elsewhere. The
comment posted by crashridedrummer is correct; you cannot prevent the
copying of the file itself or physically copying it by writing
something down or taking a photo of it. What exactly is your
definition of "copying"?


Clarification of Question by jkopelman-ga on 22 Dec 2004 03:52 PST
One day later is ok.

By "copying" I meant that the user should be prevented from copying
all or a portion of the document (ctrl-c) to the clipboard -- not
making a physical copy of the file.
Subject: Re: Microsoft Office Customization Question
Answered By: answerguru-ga on 24 Dec 2004 10:29 PST
Rated:5 out of 5 stars
Hi jkopelman,

After completing a full investigation in response to your query, I can
say that it is possible to restrict the save, print, and delete
functions within the Office suite itself. The same cannot be
guaranteed if files are opened by other applications.

In the attempt to keep Office as open to customization as possible,
Microsoft has provided a specialized language called VBA, or Visual
Basic for Applications. This is the language used to write code for
use within the collection of Office applications (including Word and
Excel). This is actually a subset of the Visual Basic programming
language and follows the same syntactic rules.

Using VBA, a developer has significant capability to alter or enhance
the functionality included by default within Office. There is a full
collection of libraries, or APIs, that facilitate this. The major
organizational units that encapsulate code segments are called
'macros' and 'functions'. One level higher, macros and functions can
be placed in a 'Module' or 'Class' - these can reside in a file or
within the Office application through a template (so that it is
applied to every file opened within the program). In addition to
allowing for the creation of customized macros which can provide
something that Office may not be capable of doing immediately, it is
also possible to 'override' the built-in features (since they are
encapsulated by macros also).

An excellent walk-through of overriding built-in functions is
available from the following

Note that the above is just a sample of some of the "obvious"
functions that would need to be overriden.  There are others, and so
additional analysis would need to eliminate any holes - though I have
attempted to provide a fairly comprehensive list. The point, though,
is that essentially anything you can do through a menu or shortcut key
can be customized. I have gone through the the set of Word commands
and tested that the following functions should be overriden as well to
prevent alternate ways of achieving the same basic means (this is for
saving, printing, and copying). Below is a list of built-in Word
functions that would need to be overriden:

DocClose - prompts to save the document and then closes the document

EditCopy - Copies the selection and puts it on the Clipboard

EditCopyAsPicture - Copies the selection and puts it on the Clipboard as a picture

EditCut - Cuts the selection and puts it on the Clipboard

FilePrint - Prints the active document (brings up dialog window first)

FilePrintDefault - Prints the active document using the current
defaults (no dialog window)

FilePrintPreview - Displays full pages as they will be printed

FilePrintPreviewFullScreen - Toggles full screen

FilePrintSetup - Changes the printer and the printing options

FileSave - Saves the active document or template

FileSaveAll - Saves all open files, macros, and AutoText entries,
prompting for each one separately

FileSaveAs - Saves a copy of the document in a separate file

FileSaveAsWebPage - Saves a copy of the document in a separate file

FileSaveFrameAs - Saves a copy of the current frame document in a separate file

FileSaveHtml - Save file as HTML document

FileSaveVersion - Saves a new version of a document

MoveText - Moves the selection to a specified location (drag and drop)

In addition to these, there are some important macros (not listed in
the list of Word commands) that are used to insert actions upon the
starting of the Office application, opening a file, and closing a
file. These are called event-based macros. A further discussion of
this is available from:

Now that we have identified some set of functionality that we would
like to alter, the next step is to determine how to have this
installed on a user's machine. THe answer to this is to use what is
called an Add-In. The user will knowingly install this add-in, which
is accessible through the 'Tools > Templates and Add-Ins' option in
case they need to remove it in the future. Since we need to be able to
install the add-in, it will be necessary to create a COM component.
Microsoft has published a detailed guide of how to do this using
several programming languages:

Visual C#.NET (C-Sharp);en-us;302901

Visual Basic.NET

Visual Basic 6.0

Visual C++

At a high level, using any of the solutions outlined in the above
links will yield an add-in which can be installed directly into an
existing Office installation.

From what I gathered regarding your ultimate intention with the final
product, I have outlined a basic architectural description some of the
major functional areas that would make sense to include in the add-in.
To keep the terminology simple, let's call "publishing" the process of
protecting a document from the actions you've stated.

1. Publishing a document

This is the process of taking an existing document and applying
functional changes to the document. In order to achieve this, the
add-in will need to place the pre-developed override and event macros
into the specific document. This will ensure that when a document is
opened elsewhere, it takes with it the desired functional alterations.
In addition, some sort of 'watermark' should be embedded in the
document. This can be done in a number of ways - an example would be
to set a non-visible property within the document.

2. Opening a published document

When a previously published document is opened on a machine that also
has the add-in installed, the add-in will recognize the 'watermark'
and open the document according to the overriden functionality defined
by the add-in. This will be done by the event macro run each time a
document is opened. Recognition of a published document can kick off
numerous other code-based customizations (you can determine the
specifics). Some suggestions would be 'graying out' toolbar options,
restricting certain keystroke combinations, etc. The possibilities
here are endless, and should only be applied to actual published
documents. You could even generate a encrypted password, so that a
published document cannot be opened unless the application includes
the add-in.

These are code-specific features - just thought you may value some suggestions :)


The above description is a very simple implementation which can be
extended to give the publisher far more power. This may include
providing an interface for the originator of the document to specify
exactly what features they may want to be made available.


As alluded to by the comment by crashridedrummer-ga, this system is
not foolproof. A determined user can access at least some of the
content of a published document in ways that you are trying to
restrict. For example, you can try to open a Word document in a plain
text editor. Although any formatting is lost, you can usually recover
a fair amount of plain text data. This is the risk of working within
an operating system that has made provisions to allow files to be
accessed by any myriad of applications. You may also want to consider
how users of alternative Office-compatible suites sun as Sun
Microsystems' OpenOffice ( may impact your
business model.

I wish you all the best in your business endeavour - if you have any
problems understanding the information above, please request a
clarification and I'll be happy to get back to you.

If you have follow-up questions that go beyond the scope of your
original question, you are welcome to direct additional questions
directed to me (answerguru-ga). Your question has really got me

All the best to you and yours this holiday season :)



Clarification of Answer by answerguru-ga on 24 Dec 2004 15:20 PST
Thank you very much for the great rating and generous tip!

jkopelman-ga rated this answer:5 out of 5 stars and gave an additional tip of: $25.00
Wonderful, timely and thorough answer.  Thanks a million!

Subject: Re: Microsoft Office Customization Question
From: crashridedrummer-ga on 21 Dec 2004 05:19 PST
Copying a document is not a microsoft office function, it's a function
of windows.  if you want documents that only certain people will be
able to view then you have to use either a program with password
functionality, such as winzip, or you'll have to write a viewer or
decryption program for your company's encrypted documents.

The problem of course is that anything can be copied, ... you can take
a photo of it, or memorise it.  Unless no-one ever gets hold of it of
course :)

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  

Google Home - Answers FAQ - Terms of Service - Privacy Policy