Jeff,

I haven't done it for Excel documents (yet) but have done the following for Word documents:

PGM
DCL VAR(&DOC) TYPE(*CHAR) LEN(100)

CHGVAR VAR(&DOC) +
VALUE('S:\IT_AS400\Documentation\Procedures\EOD_Printer.doc')
CALL PGM(DOCHANDLER) PARM(&DOC)

ENDPGM

The DocHandler Program:

PGM PARM(&DOC)
DCL VAR(&DOC) TYPE(*CHAR) LEN(100)

MONMSG MSGID(IWS4032) EXEC(GOTO CMDLBL(END))
STRPCO
MONMSG MSGID(IWS4010)


STRPCCMD PCCMD(&DOC) PAUSE(*NO)

END: ENDPGM

Jerry C. Adams
IBM System i Programmer/Analyst
--
B&W Wholesale
office: 615-995-7024
email: jerry@xxxxxxxxxxxxxxx


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jeff Crosby
Sent: Thursday, August 27, 2009 2:10 PM
To: Midrange Systems Technical Discussion
Subject: Re: STRPCCMD command to open a URL from Client Access Session

I'm dense. The following:

STRPCCMD PCCMD('rundll32 url.dll,FileProtocolHandler "www.dilgardfoods.com"')

will open our company's home page. But the same statement doesn't
work for a .xls or .doc or .pdf file. I assume that's because
rundll32 is calling url.dll which handles, well, urls. Suppose I want
to open file abc.xls. How does that look? Don't you need to know
ahead of time the PC file extension so the proper call is made? And
doesn't the START command eliminate that?

Thanks.


On Thu, Aug 27, 2009 at 2:28 PM, Scott
Klement<midrange-l@xxxxxxxxxxxxxxxx> wrote:
I've tried doing it the way Booth shows (with the "start" command), and
I've also tried doing it the way Brian May/Nick Radich shows (with
FileProtocolHandler).

I'll tell you this:  Brian/Nick's solution (FilePrototcolHandler) is
MUCH MUCH nicer.  It doesn't create the ugly MS-DOS window, it has much
fewer problems with special characters in filenames and URIs.  It's just
a much better solution.

My 2 cents.


Booth Martin wrote:
Here is a way that was recommended to me, which I've used:

http://www.martinvt.com/Code_Samples/PC_Commands/pc_commands.html

Basically,  the significant code snippet  is:

**      * Start PC Organizer if not started.
     C                   eval      wCmdString = 'STRPCO PCTA(*NO)'
     C                   callp(e)  pQCmdExc(wCmdString:
     C                              %len(%trim(wCmdString)) )
**

           * Establish the command to perform.

**     C                   select
     C                   when      PB1 = 1
     C                   eval      wCommand =
     C                               'start http://www.martinvt.com'
     C                   when      PB1 = 2
     C                   eval      wCommand =
     C                               'notepad.exe'
     C                   when      PB1 = 3
     C                   eval      wCommand =
     C                               'excel.exe'
...
****     C                   eval      wCmdString = 'strpccmd pccmd('''
     C                               + %trim(wCommand)
     C                               + ''') pause(*NO)'
     C                   callp     pQCmdExc(wCmdString:
     C                              %len(%trim(wCmdString)) )
**



Nick_Radich@xxxxxxxxxxxxxx wrote:
Hi Bob,

Here is what I have on my system to go to websites.

I have it wrapped into a Command I call WEB, that prompts for a website.


PGM        PARM(&SITE)

DCL        VAR(&CMD) TYPE(*CHAR) LEN(120)
DCL        VAR(&SITE) TYPE(*CHAR) LEN(30)

CHGVAR     VAR(&CMD) VALUE('rundll32.exe +
             url.dll,FileProtocolHandler ' *BCAT +
             'http://www.' *CAT &SITE *TCAT '.com')

STRPCO     PCTA(*NO)
MONMSG     MSGID(IWS4010)

STRPCCMD   PCCMD(&CMD) PAUSE(*NO)

ENDPGM







Thanx,

Nick



Nick Radich
Sr. Programmer/Analyst
EPC Molding, Inc.
Direct  (320) 679-6683
Toll free  (800) 388-2155  ext. 6683
Fax  (320) 679-4516
nick_radich@xxxxxxxxxxxxxx



BMay@xxxxxxxxx
Sent by: midrange-l-bounces@xxxxxxxxxxxx
08/27/2009 11:08 AM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>


To
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
cc

Subject
Re: STRPCCMD command to open a URL from Client Access Session






Try using

rundll32 url.dll,FileProtocolHandler

instead of

"C:\Program Files\Internet Explorer\IEXPLORE.EXE"

This will open whatever their default browser is no matter where it is
installed.  It can save you headaches later.

HTH,

Brian May
Project Lead
Management Information Systems
Garan, Incorporated
Starkville, Mississippi

Young i Professionals
http://www.youngiprofessionals.com



"Robert Ostrowski" <Bob.Ostrowski@xxxxxxxxxxxxxxxx>
Sent by: midrange-l-bounces@xxxxxxxxxxxx
08/27/2009 10:38 AM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>


To
<midrange-L@xxxxxxxxxxxx>
cc

Subject
STRPCCMD command to open a URL from Client Access Session






Can anybody tell me why I can't get this to work using a variable for
the URL?  Instead of going to the web site in the &URL variable,
the browser opens up to whatever the home page is set to.  If I hard
code the HTTP://...... It will work.

DCL VAR(&URL) TYPE(*CHAR) LEN(60)

MONMSG   IWS4010
CHGVAR VAR(&URL) VALUE('HTTP://WWW.GOOGLE.COM')
STRPCO     PCTA(*NO)

STRPCCMD PCCMD('"C:\Program Files\Internet Explorer\IEXPLORE.EXE" +
&URL')









Bob Ostrowski | Senior Programmer/Analyst
TRAINOR GLASS COMPANY | National - IT
11901 S. Austin Ave. | Alsip, IL 60803
T 708.293.4218 | F 708.293.6218
bob.ostrowski@xxxxxxxxxxxxxxxx
<mailto:firstname.lastname@xxxxxxxxxxxxxxxx>  | www.trainorglass.com
<http://www.trainorglass.com>

Project Management On-Line <http://webapps.trainorglass.com/>  | View
your project's progress and communicate with your project manager



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.