473,398 Members | 2,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Office program

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?
Sep 10 '06 #1
3 1303
"Alan T" <al*************@yahoo.com.auwrote in message
news:uU**************@TK2MSFTNGP04.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.CommandBars("File").Controls(5).Enabled = 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
Sep 10 '06 #2
Drill down from here:
http://msdn2.microsoft.com/en-us/lib...ment.save.aspx

chanmm

"Alan T" <al*************@yahoo.com.auwrote in message
news:uU**************@TK2MSFTNGP04.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?

Sep 11 '06 #3
Hi,

Can you tell me how do I get the Word to be opened with the specified file
name?

These are my code:

Type objClassType;

objClassType = Type.GetTypeFromProgID("Word.Application");

objApp_Late = Activator.CreateInstance(objClassType);

// how to specify the word document name ??

Parameters = new Object[1];

Parameters[0] = true;

objApp_Late.GetType().InvokeMember("Visible", BindingFlags.SetProperty,

null, objApp_Late, Parameters);

objApp_Late.GetType().InvokeMember("UserControl", BindingFlags.SetProperty,

null, objApp_Late, Parameters);
"chanmm" <ch*****@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Drill down from here:
http://msdn2.microsoft.com/en-us/lib...ment.save.aspx

chanmm

"Alan T" <al*************@yahoo.com.auwrote in message
news:uU**************@TK2MSFTNGP04.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?


Sep 25 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dkomo | last post by:
I wrote a VB 6.0 program to create an Access database file and fill it with data. I used the following DAO statement: Set db_AllEquity = ws.CreateDatabase(Database_Name, dbLangGeneral,...
3
by: Chuck Arney | last post by:
After installing Office 2003 PRO and attempting to run SETUP to install the Visual Studio Tools for Office version 2003, I get the error message "Your computer must have Microsoft Office...
2
by: William LaMartin | last post by:
I have created a program that allows for the automation of things in Word documents, like changing the values of DocVariables and the links to Excel Sheets. I did it using interoperoperatability,...
4
by: Lyle Fairfield | last post by:
I asked this question in Microsoft.Public.Word two days ago but I have not received an answer. I believe there are Office Experts here who may be able to help. --------- "A friend has Office...
5
by: Michael Russell | last post by:
Hi all, Using C#, I've created a simple wrapper class for using Excel. I have Office Pro 2003 installed on my devel machine. The wrapper class works great, reading and writing to/from Excel. ...
2
by: JC | last post by:
Anybody knows what problem has this code? I think, in the Garbage Collector? You know the Solution? The program in the test's case, whit 350 contacts, run OK before number 86. The error is a...
0
by: salad | last post by:
I took the Bart down to San Francisco and joined a couple thousand other nerds to watch the Vista/Office launch. The receptionist was quite pleasant and getting the event packets a smooth...
11
by: Don | last post by:
QUESTIONS: 1. Has anyone figured out how to successfully install the Office 97 Pro Service Release 2 patch in Vista? 2. Has anyone successfully installed an Office 97 Pro CD (SR2 version) in...
1
by: Leonid Lastovkin | last post by:
I would like to be able to find out which version of Microsoft Office is installed on the host computer. How can I implement this query in C#? I do not need the whole program, but a relevant code...
3
by: Chuck | last post by:
I've been having problems with Access and Excel talking to one another. In the process of trying to add features (programs) to Access 97 I have lost the ability to export an Access query to an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.