From: Mark A J. <maj...@ra...> - 2004-04-20 06:30:19
|
All, I have HELP files for my TCL application which are WORD documents. I wish to bring up these WORD files from within my TCL/TK application as "ON LINE HELP". The problem I have run into is when the path is constructed by my TCL application, the path to the WORD document contains forward slashes ("/" ). When the HELP files are called from the computer where the HELP files are stored, they work fine. However, when the HELP files are called from a computer on my local network, the WORD application does not find the HELP files because WORD uses the backward slash ("\") on the windows platform for the path to files. Thus, I have a conflict between what TCL creates for me ... namely the forward slash ("/" ) for the path to the HELP file versus what WORD uses ... namely the backward slash ("\" ) for the path to the HELP file. How can I have TCL create the path to the HELP file with the backward slash ("\" ) instead of the forward slash ("/" ) so that the ON LINE HELP files can be launched from a computer on my local network (other than the "master_computer"), by WORD? As a NOTE ... ALL the code for my application resides on the "master_computer", however the application can be run from other computers on my local network. I have software links on each of the computers on the local network to run the application from the "master_computer". In the sample code below ... "sum" stands for Software User Manual The path to help files are : C:/gui/sum/volume_1_help.doc C:/gui/sum/volume_2_help.doc C:/gui/sum/volume_3_help.doc ... C:/gui/sum/volume_n_help.doc The TCL program is located in the following path : C:/gui [pwd] returns .... C:/gui ======================================= Sample code BEGINS ... set WORD_EXE "Winword.exe" set MANUAL_DIR [file join [pwd] sum] set INTRO_HELP [file join $MANUAL_DIR volume_1_help.doc] set ORGANIZATION_HELP [file join $MANUAL_DIR volume_2_help.doc] set STRUCTURE_HELP [file join $MANUAL_DIR volume_3_help.doc] ... set XYZ_HELP [file join $MANUAL_DIR volume_n_help.doc] Sample code ENDS ... ======================================= From a HELP menu in my applicaton Additional sample code BEGINS ... $help_menu add command \ -label "Introduction Manual" -command { exec $WORD_EXE $INTRO_HELP & } $help_menu add command \ -label "Organization Manual" -command { exec $WORD_EXE $ORGANIZATION_HELP & } ... $help_menu add command \ -label " XYZ Manual" -command { exec $WORD_EXE $XYZ_HELP & } Additional sample code ENDS ... ======================================= As I stated above, when application is run from the "master_computer", the HELP files are launched from WORD. The path to the HELP file for volume 1 is : C:/gui/sum/volume_1_help.doc When the application is run from a computer on my local network, the HELP files are NOT found by WORD, since WORD uses the backward slash ("\" ) to find the document that is to be launched. The path created by TCL to the HELP files from from the computer on my local network for volume 1 is : //master_computer/gui/sum/volume_1_help.doc What WORD requires to find the files from computers on my local network is : \\master_computer\gui\sum\volume_1_help.doc This was proved in two ways : 1) WORD was launched from a computer on the local network and I navigated to the HELP files on the "master_computer" via the "My Network Places" and opened the files without any problems. 2) From a "Command Prompt" window I typed the following commands a) Winword.exe \\master_computer\gui\sum\volume_1_help.doc b) Winword.exe //master_computer/gui/sum/volume_1_help.doc WORD launches the HELP file in 2a) but 2b) results in just WORD being launched without the HELP file opened ... since WORD can not find the file because the SLASHES are not correct for WORD to find the file in the specified path. Any help would be GREATLY appreciated to help me ... BUILD THE PATH TO MY HELP FILES ... with backward slashes ("\" ) so that WORD will find the HELP files. Mark |