Results 1 to 14 of 14
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Does anyone have code to open app from another app

    HI ya
    Does anyone have any code which from one application can open up another application?
    From Word 97 I would like to open Adobe distiller.

    Thanks in advance Diana

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Does anyone have code to open app from another app

    Try:<pre>Shell "<PathName>"</pre>


  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Does anyone have code to open app from another app

    Application.FollowHyperlink .....
    Does a great job!

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Does anyone have code to open app from another app

    Let's not forget

    Application.Run

    and the API call ShellExecute.

    Also, if you are trying to start the Abode PDF maker, one assumes you have Acrobat installed. If my assumption is correct, then you also have PDFMaker installed. You can call the OnAction sub that the PDFMaker toolbar button uses and launch the distiller:

    Call PDFMAker.DoPrefsForm

    And while you're at it, why not try calling the Distiller directly. I have no idea if that would work for you, but it looks like a reasonable thing to do:

    DistillFile(sInputFilename As String, sOutputFilename As String, sJobOptionsFilename As String)
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  5. #5
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Does anyone have code to open app from another app

    Exactly what are you trying to do? Are you trying to save a Word doc as PDF? Distiller has a watch folder option. It will convert any postscript file to PDF that it finds in a folder.

  6. #6
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Does anyone have code to open app from another app

    Hi Mike

    The logic of what I'm attempting to do is the following:

    Determine if Adobe Distiller applicaition is open.
    If not - then open up applicaiton (from word)
    convert word file to postscript & specify where the resulting postscript file is going to be stored.
    ie in C:TempIn
    With Acrobat Distiller convert postscript file to PDF.

    I then have to move file out of C:tempIn directory to
    C:Temp
    This poses another problem as I'm now experiencing file access & file locking
    if the file is a large file I will have to write code to pause & do a timer counter so I can have access to file to move.

    does this clear things up - cheers Diana

  7. #7
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Does anyone have code to open app from another app

    HI Kevin

    I have Adobe Acrobat Distiller installed but I'm not familiar with the call OnAction sub you mentioned.
    Have you used this before?
    how do I use?
    Do you have code to do this?

    Thanks in advance Diana

  8. #8
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Does anyone have code to open app from another app

    its now resolved & thanking you all who responded
    cheers Diana

  9. #9
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Does anyone have code to open app from another app

    Don't keep us in suspense. Tell us how you solved it! Maybe someone out there has a similar problem. <img src=/S/question.gif border=0 alt=question width=15 height=15> <img src=/S/question.gif border=0 alt=question width=15 height=15> <img src=/S/question.gif border=0 alt=question width=15 height=15> <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  10. #10
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Does anyone have code to open app from another app

    Depends on what you mean by "clear"

    There's a cloud over my head...

    But I'll not pester much except to inquire about that middle postscript step. Is that necessary? Why not just launch the distiller on the Word document?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  11. #11
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Canton, Ohio, USA
    Posts
    270
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Does anyone have code to open app from another app

    I'm trying to accomplish exactly what you describe via Acrobat Distiller. Later, in another message, you stated that everything was resolved. Can you provide the VBA code you used to ensure Acrobat Distiller was running? Any additional commentary of insight or issues I need to be cognizant of is also appreciated. THANK YOU. <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

  12. #12
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Does anyone have code to open app from another app

    Hi Jim - please find code below.
    Other factors you may want to consider:

    normally when you manually open up distiller - it will create folders 'in' & 'out' if doesnt exist.
    When opening up distiller using code automation - doesnt create folders - therefore you have to create using code.

    In our environment - the distiller folders to be stored in C:temp
    Our network housekeeping cleans out C:temp
    when user logs on/off.
    Therefore I have code to check if folders exist & then create.

    also
    I have code which obtains the users current default printer
    when converting to PDF - changes to the current pdf printer driver.
    when task completed
    resets printer to users default printer.
    hope this helps! Diana



    'I have code here that checks in registry if adobe distiler printer driver exists.
    If doesnt exist -then software application isnt installed.- exit code


    'if user logged onto citrix & PDF printer found
    'check if Acrobat Disitller application is open
    If blnLoggedOnCitrix = True And PDFPrinterFound = True Then

    'call function blnIsAppRunning - to check if distiller application is running
    If blnIsAppRunning("Acrobat Distiller") Then
    Else
    'else if distiller application not running then fire up application
    Dim RetVal
    RetVal = Shell("C:Program FilesDistillrAcroDist.exe", 6) ' Run Acrobat distiller
    EndIf
    EndIF


    'if user logged onto citrix server then PDF file will
    'need to be generated using different methods ie by Adobe Acrobat Distiller.
    If blnLoggedOnCitrix = True Then

    'PDF file created by application Adobe Acrobat Distiller
    'Distiller needs directories 'In' & 'Out' -
    'check if directories exist- if not create folders to store postscript files
    Dim strTempFolder As String
    'strTempFolder = Environ("Temp") + "In"
    strTempFolder = "C:TempIn"

  13. #13
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Does anyone have code to open app from another app

    Mike - the following code is how I resolved this particular issue from Word 97 open up another software application being Adobe acrobat distiller:
    hope this helps - Diana

    'call function blnIsAppRunning to check if distiller application is running
    If blnIsAppRunning("Acrobat Distiller") Then
    Else
    'else if distiller application not running then fire up application

    Dim RetVal
    RetVal = Shell("C:Program FilesDistillrAcroDist.exe", 6) ' Run Acrobat distiller
    End If


    'Function: blnIsAppRunning(ByVal vsAppName As String) As Boolean
    'Purpose: checks if application currently open & running
    'Inputs: pass in name of application to check
    'Returns: true or false in boolean status - blnIsAppRunning
    Public Function blnIsAppRunning(ByVal vsAppName As String) As Boolean
    Dim aTask As Task
    blnIsAppRunning = False

    For Each aTask In Tasks
    If aTask.Name = vsAppName Then
    blnIsAppRunning = True
    Exit Function
    End If
    Next aTask
    End Function

  14. #14
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Canton, Ohio, USA
    Posts
    270
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Does anyone have code to open app from another app

    Diana,
    Thanks for the info. I will begin testing code, etc. today! Have a great Day!

Posting Permissions

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