CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2006
    Posts
    170

    Run word application

    Hi All ,


    i just need to add a button to my application called "Word"

    when the user click it it opens the word appliaction.

    i cann add microsoft word refreance to my appliaction , but what to do after that ?

  2. #2
    Join Date
    Mar 2006
    Location
    Craiova, Romania
    Posts
    439

    Re: Run word application

    If you want just to open Ms Word and not interact with you can use the simple process class:
    Code:
    Process notePad = new Process();
    notePad.StartInfo.FileName   = "notepad.exe"; 
    notePad.StartInfo.Arguments = "me.txt";
    notePad.Start();
    Else read this
    Bogdan

    If someone helped you then please Rate his post and mark the thread as Resolved
    Please improve your messages appearance by using tags [ code] Place your code here [ /code]

  3. #3
    Join Date
    Oct 2006
    Posts
    170

    Re: Run word application

    i tried your code but it gives me this error

    The type or namespace name 'Process' could not be found (are you missing a using directive or an assembly reference?)


    although i have addes the following using :

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    using Microsoft.Office;
    using Microsoft.Office.Core;
    using System.Runtime.InteropServices;


    using Word = Microsoft.Office.Interop.Word;
    using System.IO;

  4. #4
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Run word application

    Process class belongs to System.Diagnostics namespace.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured