"Alan T" <al************ *@yahoo.com.auw rote in message
news:uU******** ******@TK2MSFTN GP04.phx.gbl...
>I would like to start a MS Word program to open a specified document,
that's fine by calling Process.Start() .
However, I would like to offer the user only Save option to save the
document, ie no "Save As".
Any idea?
I'm not sure you can do this with Process.Start() , because all that does (in
your case) is take a document, examine its file extension, then open it with
whatever application is defined as the default application for that
extension. In Explorer, change the default application for .doc from Word to
Wordpad and you'll see what I mean.
Secondly, you need to do more than just force Windows to open a document
with its default application - you need to manipulate that application when
it starts.
To do this, you need to use Office Automation.
The following MSDN article shows you how to do this - it uses Excel, but the
principle is the same:
http://support.microsoft.com/kb/302902/
Once you have your Word application object (e.g. objWord), do the following:
objWord.Command Bars("File").Co ntrols(5).Enabl ed = False
Obviously, you should enhance this so that it actually checks that
Controls(5) on the File menu is actually the Save As menuitem etc...
You should also have a look at this, if you haven't already:
http://www.microsoft.com/downloads/d...displaylang=en