hexagon logo

Open word document from PCL

Hi,
 
I could not open word document from below PCL commands. Please suggest.
 
sys_get_env ( "CAPA_PATH", exe_path)    
exe_path = exe_path//"Help.docx"     
cmd2 = "cmd //c " // exe_path
utl_process_spawn(cmd2, FALSE)
  • Bala,
    Here's a simple  example to start Microsoft Word and open a file called help.docx in the same folder as the current Patran folder (add complete path if it's in another folder).
    STRING cmd2[120]
    cmd2="cmd //c start winword help.docx"
    utl_process_spawn(cmd2, FALSE)
    Diagnosis tips when things don't work as expected:
    1) Be sure all strings are property allocated so long strings aren't truncated.
     
    2) Include ui_write statements to confirm string values in your code.
    For example, adding ui_write("cmd2 = " // cmd2 ) to example above creates this output:
    $# cmd2 = cmd //c start winword help.docx
     
    3) Verify commands work on the command line!