How to open a Word doc.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: How to open a Word doc.

  1. #1
    Jacques Labbe Guest

    How to open a Word doc.

    Can anyone tell me how to open a Word document, sitting in a public
    folder, on an Exchange server, from a VB6 app?

    My VB app is an index of documents, for example:

    //Public Folders/Our Enterprise/MyDocument.doc

    and I want our users to be able to click on a control and have the
    document open.

    Any hints would be appreciated!


  2. #2
    Ian Drake Guest

    Re: How to open a Word doc.


    Jacques

    I assume that you want the document to open in a standard word environment...

    Set w = New Word.Application
    Dim w As Word.Application
    w.Documents.Open "c:\test.doc"
    w.Visible = True

    there you go..
    Ian Drake

    Jacques Labbe <jacques.labbe@jus.gov.on.ca> wrote:
    >Can anyone tell me how to open a Word document, sitting in a public
    >folder, on an Exchange server, from a VB6 app?
    >
    >My VB app is an index of documents, for example:
    >
    >//Public Folders/Our Enterprise/MyDocument.doc
    >
    >and I want our users to be able to click on a control and have the
    >document open.
    >
    >Any hints would be appreciated!
    >



  3. #3
    Jacques Labbe Guest

    Re: How to open a Word doc.

    Thanks Ian,

    .... but my problem is with the actual path to the document. The documents reside
    in the Public Folders area on an Exchange server. We normally get to them
    through Outlook. I can open it using ShellExecute
    "outlook://PublicFolders/etc/~document.doc"
    but that opens Outlook then Word, then brings up a Closing Outlook dialog etc.
    Messy, messy, messy!

    Using your technique and inserting my path yields error 5273 - "Document name or
    path is not valid." I've tried the path every which way I can think of and still
    the same result."

    Thanks
    jacques

    Ian Drake wrote:

    > Jacques
    >
    > I assume that you want the document to open in a standard word environment...
    >
    > Set w = New Word.Application
    > Dim w As Word.Application
    > w.Documents.Open "c:\test.doc"
    > w.Visible = True
    >
    > there you go..
    > Ian Drake
    >
    > Jacques Labbe <jacques.labbe@jus.gov.on.ca> wrote:
    > >Can anyone tell me how to open a Word document, sitting in a public
    > >folder, on an Exchange server, from a VB6 app?
    > >
    > >My VB app is an index of documents, for example:
    > >
    > >//Public Folders/Our Enterprise/MyDocument.doc
    > >
    > >and I want our users to be able to click on a control and have the
    > >document open.
    > >
    > >Any hints would be appreciated!
    > >



  4. #4
    Norm Cook Guest

    Re: How to open a Word doc.

    I think you need to map a logical drive to the network path. Right click My
    Computer, Map Network Drive, select a drive letter, then enter your path,
    //Public Folders/Our Enterprise

    Then you should be able to
    w.Documents.Open "e:\test.doc"
    or whatever drive you mapped.

    Good luck.

    "Jacques Labbe" <jacques.labbe@jus.gov.on.ca> wrote in message
    news:39C28C0F.296C8EFD@jus.gov.on.ca...
    > Thanks Ian,
    >
    > ... but my problem is with the actual path to the document. The documents

    reside
    > in the Public Folders area on an Exchange server. We normally get to them
    > through Outlook. I can open it using ShellExecute
    > "outlook://PublicFolders/etc/~document.doc"
    > but that opens Outlook then Word, then brings up a Closing Outlook dialog

    etc.
    > Messy, messy, messy!
    >
    > Using your technique and inserting my path yields error 5273 - "Document

    name or
    > path is not valid." I've tried the path every which way I can think of

    and still
    > the same result."
    >
    > Thanks
    > jacques
    >
    > Ian Drake wrote:
    >
    > > Jacques
    > >
    > > I assume that you want the document to open in a standard word

    environment...
    > >
    > > Set w = New Word.Application
    > > Dim w As Word.Application
    > > w.Documents.Open "c:\test.doc"
    > > w.Visible = True
    > >
    > > there you go..
    > > Ian Drake
    > >
    > > Jacques Labbe <jacques.labbe@jus.gov.on.ca> wrote:
    > > >Can anyone tell me how to open a Word document, sitting in a public
    > > >folder, on an Exchange server, from a VB6 app?
    > > >
    > > >My VB app is an index of documents, for example:
    > > >
    > > >//Public Folders/Our Enterprise/MyDocument.doc
    > > >
    > > >and I want our users to be able to click on a control and have the
    > > >document open.
    > > >
    > > >Any hints would be appreciated!
    > > >

    >




  5. #5
    Jacques Labbe Guest

    Re: How to open a Word doc.

    Thanks Norm,
    If it were just for my use, that solution would work fine. However, this app
    has to go out to over 600 users. I've relied on mapped drives before in much
    smaller environments and the support is a nightmare with users losing their
    mapping.

    I'm going to have to keep looking.

    Jacques

    Norm Cook wrote:

    > I think you need to map a logical drive to the network path. Right click My
    > Computer, Map Network Drive, select a drive letter, then enter your path,
    > //Public Folders/Our Enterprise
    >
    > Then you should be able to
    > w.Documents.Open "e:\test.doc"
    > or whatever drive you mapped.
    >
    > Good luck.
    >
    > "Jacques Labbe" <jacques.labbe@jus.gov.on.ca> wrote in message
    > news:39C28C0F.296C8EFD@jus.gov.on.ca...
    > > Thanks Ian,
    > >
    > > ... but my problem is with the actual path to the document. The documents

    > reside
    > > in the Public Folders area on an Exchange server. We normally get to them
    > > through Outlook. I can open it using ShellExecute
    > > "outlook://PublicFolders/etc/~document.doc"
    > > but that opens Outlook then Word, then brings up a Closing Outlook dialog

    > etc.
    > > Messy, messy, messy!
    > >
    > > Using your technique and inserting my path yields error 5273 - "Document

    > name or
    > > path is not valid." I've tried the path every which way I can think of

    > and still
    > > the same result."
    > >
    > > Thanks
    > > jacques
    > >
    > > Ian Drake wrote:
    > >
    > > > Jacques
    > > >
    > > > I assume that you want the document to open in a standard word

    > environment...
    > > >
    > > > Set w = New Word.Application
    > > > Dim w As Word.Application
    > > > w.Documents.Open "c:\test.doc"
    > > > w.Visible = True
    > > >
    > > > there you go..
    > > > Ian Drake
    > > >
    > > > Jacques Labbe <jacques.labbe@jus.gov.on.ca> wrote:
    > > > >Can anyone tell me how to open a Word document, sitting in a public
    > > > >folder, on an Exchange server, from a VB6 app?
    > > > >
    > > > >My VB app is an index of documents, for example:
    > > > >
    > > > >//Public Folders/Our Enterprise/MyDocument.doc
    > > > >
    > > > >and I want our users to be able to click on a control and have the
    > > > >document open.
    > > > >
    > > > >Any hints would be appreciated!
    > > > >

    > >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center