Additional Sample App Code II - 352 KB
Listing 1
integer li_rc
string ls_curver
li_rc = RegistryGet ( &
"HKEY_CLASSES_ROOT\Word.Application\CurVer", &
"", RegString!, ls_curver )
IF li_rc < 0 THEN
MessageBox ( "OLE Error", &
"Could not determine the version " + &
"of Word installed." )
Return -1
END IF
CHOOSE CASE lower ( ls_curver )
CASE "word.application.8"
inv_word = CREATE n_cst_ole_word_97
CASE "word.application.9"
inv_word = CREATE n_cst_ole_word_2000
CASE "word.application.10"
inv_word = CREATE n_cst_ole_word_xp
CASE ELSE
MessageBox ( "OLE Error", &
"I do not know how to handle " + &
"the version of Word installed." )
Return -1
END CHOOSE
try
Return inv_word.of_connect()
catch ( Throwable MyError )
Return -1
end try
Additional Sample App Code II - 352 KB