Posted by: Karen Clench
If MS Word is not already open on the desktop my application
successfully launches Word and displays the WORD document.
However When MSWord is already open -
this stmt is true and the message box 'Something went wrong' is display.
If NOT oDocs.Open ( vFileName, vConfirmConversions, vReadOnly,
vAddToRecentFiles, vPasswordDocument, vPasswordTemplate,
vRevert, vWritePasswordDocument,
vWritePasswordTemplate, vFormat, vEncoding, vVisible, oDoc )
Has anyone else had a problem with this situation where Word is Already
open and we need to open another .doc via CTD? I am running WINXP,
CTD2.1, ptf2. Microsoft Word 9.0 Object Library.apl
I have reviewed posts from both the talkto.guptaworldwide newsgroup and
the current newsgroup for posting on this but cannot find this
situation. Thank you in advance for your help.
Code: Select all
!!CB!! 70
Call true.SetBoolean(TRUE)
Call false.SetBoolean(FALSE)
Call vBool.SetBoolean( FALSE )
Call SalActiveXAutoErrorMode( FALSE )
Call vDummy.MakeOptional( )
If not SalActiveXGetActiveObject(oWordApp,'Word.Application')
Call oWordApp.Create ( )
Call oWordApp.PropSetVisible ( TRUE )
Call oWordApp.PropGetDocuments ( oDocs )
Call vFileName.SetString( psFile )
Call vConfirmConversions.SetBoolean ( FALSE )
Call vReadOnly.SetBoolean ( FALSE )
Call vAddToRecentFiles.SetBoolean ( FALSE )
Call vPasswordDocument.SetString ( '' )
Call vPasswordTemplate.SetString ( '' )
Call vRevert.SetBoolean ( FALSE )
Call vWritePasswordDocument.SetString ( '' )
Call vWritePasswordTemplate.SetString ( '' )
Call vFormat.SetNumber ( 0, VT_I2 )
Call vEncoding.SetNumber ( 0, VT_I2 )
Call vVisible.SetNumber ( 1, VT_I2 )
! !
If NOT oDocs.Open ( vFileName, vConfirmConversions, vReadOnly,
vAddToRecentFiles, vPasswordDocument, vPasswordTemplate,
vRevert, vWritePasswordDocument,
vWritePasswordTemplate, vFormat, vEncoding, vVisible, oDoc )
Set fbOk = FALSE
Call SalMessageBox( 'Something went Wrong.',
'Application Did Not Launch', MB_Ok )
Else
Set fbOk = TRUE