Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Edison, New Jersey, USA
    Posts
    215
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Opening a PDF file from Word (Word 97)

    I am wanting to open a file (a reference document) that is a PDF, from a word template. I know that I have to open Adobe first, and tried the following lines... but I'm not quite right....


    ChangeFileOpenDirectory _
    "C:Program FilesAdobeAcrobat 4.0AcrobatAcrobat.exe/C:Program FilesMicrosoft OfficeTemplatesCIS TEMPLATESref"
    Documents.Open FileName:="IS_DataModel_Guidelines.pdf", ConfirmConversions:= _



    Help!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Opening a PDF file from Word (Word 97)

    You don't have to open Acrobat Reader first. You can open a .pdf document with

    ActiveDocument.FollowHyperlink "C:MyDocsTest.pdf"

    or by using ShellExecute. ShellExecute provides the equivalent of opening (or printing) a file in Windows Explorer.

    To use it, put the following code in a standard module:

    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    (ByVal hwnd As Long, _
    ByVal lpOperation As String, _
    ByVal lpFile As String, _
    ByVal lpParameters As String, _
    ByVal lpDirectory As String, _
    ByVal nShowCmd As Long) As Long

    Private Const SW_SHOWMAXIMIZED As Long = 3

    To use it, call it like this:

    Dim lngResult As Long

    lngResult = ShellExecute(0&, "Open", _
    "C:MyDocsTest.pdf", 0&, 0&, SW_SHOWMAXIMIZED)
    If lngResult <= 32 Then
    MsgBox "Couldn

  3. #3
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Edison, New Jersey, USA
    Posts
    215
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Opening a PDF file from Word (Word 97)

    AWESOME... IT worked! What a pick-up to a day that has been deadends!

Posting Permissions

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