Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to Open a .doc file using VC++ command

How to Open a .doc file using VC++ command

Scheduled Pinned Locked Moved C / C++ / MFC
c++linuxhelptutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    himuskanhere
    wrote on last edited by
    #1

    Hello frnds... I need a help... I have file with .doc ext and i want to open that file in MSWord.. Just like a Shell in VB. WinExec will open a Word application as a blank app.... I want to Open File1.doc in MSWorld Thanks. :cool:

    N K D 3 Replies Last reply
    0
    • H himuskanhere

      Hello frnds... I need a help... I have file with .doc ext and i want to open that file in MSWord.. Just like a Shell in VB. WinExec will open a Word application as a blank app.... I want to Open File1.doc in MSWorld Thanks. :cool:

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      himuskanhere wrote:

      I want to Open File1.doc in MSWorld

      ShellExecute( NULL, _T("open"), _T("C:\\Open File1.doc"), 0, 0, SW_SHOW );

      nave [OpenedFileFinder]

      1 Reply Last reply
      0
      • H himuskanhere

        Hello frnds... I need a help... I have file with .doc ext and i want to open that file in MSWord.. Just like a Shell in VB. WinExec will open a Word application as a blank app.... I want to Open File1.doc in MSWorld Thanks. :cool:

        K Offline
        K Offline
        KASR1
        wrote on last edited by
        #3

        Try this

        CString sPathName = "......\File1.doc";
        ShellExecute(AfxGetMainWnd()->GetSafeHwnd(), "open", "winword",sPathName, NULL, SW_SHOWNORMAL);

        1 Reply Last reply
        0
        • H himuskanhere

          Hello frnds... I need a help... I have file with .doc ext and i want to open that file in MSWord.. Just like a Shell in VB. WinExec will open a Word application as a blank app.... I want to Open File1.doc in MSWorld Thanks. :cool:

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          See here.

          "Love people and use things, not love things and use people." - Unknown

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups