473,947 Members | 16,021 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1321
"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
Sep 10 '06 #2
Drill down from here:
http://msdn2.microsoft.com/en-us/lib...ment.save.aspx

chanmm

"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?

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.GetTypeFro mProgID("Word.A pplication");

objApp_Late = Activator.Creat eInstance(objCl assType);

// how to specify the word document name ??

Parameters = new Object[1];

Parameters[0] = true;

objApp_Late.Get Type().InvokeMe mber("Visible", BindingFlags.Se tProperty,

null, objApp_Late, Parameters);

objApp_Late.Get Type().InvokeMe mber("UserContr ol", BindingFlags.Se tProperty,

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

chanmm

"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?


Sep 25 '06 #4

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

Similar topics

1
3625
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, dbVersion30) On my older computer I can open the .mdb file with Office 97 Access with no problem
3
646
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 Professional Edition 2003 installed before you can install Microsoft Visual Studio Tools for the Microsoft Office System.". SETUP terminates after clicking OK. I have VS Ent Arch 2003 installed on the machine. In fact, I previously had the beta...
2
11510
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, where, after adding a reference to Microsoft.Office.Core and a reference to Microsoft Word I declare objects as follows: Dim oWordApp As New Microsoft.Office.Interop.Word.Application, . Everything works fine on the development computer...
4
1693
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 2000. She is a high school student. English is not her first language. I find the "Lookup" facility in Word 2003 very useful. I think she woud
5
49862
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. To do this, I created a reference to "Microsoft Excel 11.0 Object Library", and have a "using Excel;" directive. I decided to add a method for creating a TextBox using the Shapes.AddTextBox method, which requires a
2
7322
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 "Array index out of bounds". Microsoft.Office.Interop.Outlook._Application olApp = new Microsoft.Office.Interop.Outlook.ApplicationClass(); Microsoft.Office.Interop.Outlook._NameSpace olNs = olApp.GetNamespace("MAPI");
0
1683
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 process. First we watched the standord keynote session where companies that have implemented Vista extolled its virtues. Vista appears to be a nice operating system. I think the desktop action
11
20258
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 Vista? DETAILS: My setup: Dell Inspiron notebook with Vista Business edition My CD: Office 97 Professional (Service Release 1) Upgrade
1
10098
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 snippet will be appreciated. Thanks.
3
5014
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 external file in Excel 97 format. It was there yesterday, but it's gone today. Other formats are also gone. I have found the Value Pack on the original Office 97 Pro CD. It looks like I can install drivers directly from the value pack. There is an...
0
10162
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9982
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11159
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11346
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9887
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7429
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6114
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4537
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3542
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.