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
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » 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)
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
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
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.
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”
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications