Results 1 to 4 of 4

Thread: Open File in .NET

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2005
    Posts
    29

    Open File in .NET

    Hello,


    process.start("c:\mydoc.doc") is efficient in a way that it will automatically open and run the associated application to open the file, my problem now is, it is possible that the application like MsWord will run under the .net application not in a separate windows? like the OLE, I will just allocate a space in my form and the opened file is viewed in that space?


    thanks....

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Open File in .NET

    Yes and no. You can place a WebBrowser control on your form and then navigate it to a Word document. The control uses the IE engine so it can host Office documents. There can be some issues doing it this way though.

    There's no other control specifically intended to host Office documents though. You could use the SetParent API to parent the application's main form within yours, but that can cause some issues too.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2005
    Posts
    29

    Re: Open File in .NET

    thanks john,

    Issues you mean problems that will encounter? in that given scenario what is the best way to do it?

  4. #4
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Open File in .NET

    Well, you could always try the SetParent way to see if thats what you're after. take a look. It will display the process window inside a container of your choice, but it'll also display the titlebar with minimize, maximize, and close buttons so you'd have to deal with problems caused by the user minimizing the window while its inside your container. And possibly other issues aswell
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

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