Consulting

Results 1 to 4 of 4

Thread: Open a specific word doc

  1. #1

    Open a specific word doc

    I am trying to open a specific word doc from xls

    I have searched the forum and all word related threads are more complicated, I imagine that this would only require a fex lines ?

  2. #2
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Greetings Neodubois,

    Is the word document in the same folder as the workbook? Not a big deal whether yes or no, just would like any respondant to be able to provide the best answer first time out.

    Mark

  3. #3
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    If all you want to do is open it, you could use a hyperlink or by VBA:
    [VBA] Shell "CMD /c c:\myfiles\wp\ken.doc"[/VBA]

  4. #4
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    or.. as an alternative:
    [VBA]
    Option Explicit
    Sub OpenDocFile()
    ' ActiveWorkbook.FollowHyperlink Address:="C:\temp\help.doc", _
    'if doc is in same directory as excel file
    ActiveWorkbook.FollowHyperlink Address:="help.doc", _
    NewWindow:=True
    End Sub
    [/VBA]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

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