gibaf Posted February 22, 2008 Report Share Posted February 22, 2008 Ola, a todos ! Estou precisando abrir um arquivo (simplesmente abrir o arquivo, sem enviar dados da app pro word), mas nao estou conseguindo. Estou tentando com: 1) nOk := WinExec( "START " + cArquivo , 1 ) // resulta 2 2) nOk := WinExec( cArquivo , 1 ) // resulta 11 Tambem ja tentei com : 1) tWord e 2) oActiveX = TActiveX():New( oDlgApp , cString ) mas sem sucesso ! o meu windows eh xp 2007 e o word tambem eh 2007 ! Se alguem puder ajudar, fico muito agradecido ! MUITO OBRIGADO ! Gilberto Frohlich - Toledo/PR giba_f@hotmail.com giba_f@yahoo.com.br xHarbour Comercial xBuild Mar_06+Fivewin 2.7+PellesC+(Postgres+DB2) Quote Link to comment Share on other sites More sharing options...
gibaf Posted February 22, 2008 Author Report Share Posted February 22, 2008 Ola, a todos ! Estou precisando abrir um arquivo (simplesmente abrir o arquivo, sem enviar dados da app pro word), mas nao estou conseguindo. Estou tentando com: 1) nOk := WinExec( "START " + cArquivo , 1 ) // resulta 2 2) nOk := WinExec( cArquivo , 1 ) // resulta 11 Tambem ja tentei com : 1) tWord e 2) oActiveX = TActiveX():New( oDlgApp , cString ) mas sem sucesso ! o meu windows eh xp 2007 e o word tambem eh 2007 ! Se alguem puder ajudar, fico muito agradecido ! MUITO OBRIGADO ! Gilberto Frohlich - Toledo/PR giba_f@hotmail.com giba_f@yahoo.com.br xHarbour Comercial xBuild Mar_06+Fivewin 2.7+PellesC+(Postgres+DB2) Quote Link to comment Share on other sites More sharing options...
Yury Posted February 22, 2008 Report Share Posted February 22, 2008 olá, cArquivo:='c:\vsis\mtb\wrk\mtyma001.doc' ShellExecute(GetActiveWindow(),"open",cArquivo) id=code>id=code>um abraço Yury Marcelino Al Viman Sistemas vimansca@vimansca.com.br yury030575@yahoo.com.br (msn) skype: yury.marcelino.al Leme / SP FW 2.6 / [x]Harbour 99.50 / WS / xDev 0.65 / @say Quote Link to comment Share on other sites More sharing options...
sygecom Posted February 22, 2008 Report Share Posted February 22, 2008 ....ou: ************************* Function Abre_Manual(cArq) // o mome do word vem por parametro ************************* LOCAL oWord,oText,oDoc GERAFILE() // gera um nome temporario RenameFile( cARQ, cFILE+".DOC" ) cARQ=cFILE+".DOC" TRY oWord := GetActiveObject( "Word.Application" ) CATCH TRY oWord := CreateObject( "Word.Application" ) CATCH MsgStop("Não foi Possivel Achar o Word Instalado","Aviso do Sistema") RETURN END END IF !FILE(cARQ) MsgStop("Não Foi possivel Abrir o Documento de Word") RETURN ENDIF oDoc := oWord:Documents:Open(cARQ) //ABRE O WORD oWord:Visible := .T. //PARA VISUALIZAR OU NÃO ANTES oWord:WindowState := 1 // Inicia na pagina ? //oWord:PrintOut() //PARA IMPRIMIR DIRETO RETURN id=code>id=code>Leonardo Machado Porto Alegre-RS Hwgui + Mysql / xHarbour 0.99.70 / BCC55 / Vrmm / xDev /Migrando aos Pouco para Fivewin 2.7 + PostgreSql Quote Link to comment Share on other sites More sharing options...
kleyber Posted February 22, 2008 Report Share Posted February 22, 2008 Yuri, O Office que Gilberto está usando é o 2007. E essa versão usa por default arquivos do tipo .DOCX. Vc já experimentou a classe TWord com o Office 2007? Abraço Kleyber Derick xHarbour 99.71 + FWH 7.11 (BMW Zerada!!!) + xDevStudio + SQLLIB Visite São LuÃs - MA A Ilha dos Amores Quote Link to comment Share on other sites More sharing options...
giovanyvecchi Posted February 22, 2008 Report Share Posted February 22, 2008 Tente com o RunFile veja em http://www.fivewin.com.br/forum/topic.asp?TOPIC_ID=9379 Giovany Vecchi - Jales - SP FWH 2.8 /Clipper 5.3b /Blinker 5.0 / Harbour 0.99 / xHarbour 99.71/ Bcc 5.6 / Ads 7.1 /PellesC Quote Link to comment Share on other sites More sharing options...
gibaf Posted February 22, 2008 Author Report Share Posted February 22, 2008 Obrigado a todos !!! deu certo com: ShellExecute( GetActiveWindow() , "open" , cArquivo ) MUITISSIMO OBRIGADO !!! Gilberto Frohlich - Toledo/PR giba_f@hotmail.com giba_f@yahoo.com.br xHarbour Comercial xBuild Mar_06+Fivewin 2.7+PellesC+(Postgres+DB2) Quote Link to comment Share on other sites More sharing options...
Yury Posted February 22, 2008 Report Share Posted February 22, 2008 citação:Yuri, O Office que Gilberto está usando é o 2007. E essa versão usa por default arquivos do tipo .DOCX. Vc já experimentou a classe TWord com o Office 2007? Abraço Kleyber Derick xHarbour 99.71 + FWH 7.11 (BMW Zerada!!!) + xDevStudio + SQLLIB Visite São LuÃs - MA A Ilha dos Amores id=quote>id=quote>olá Kleyber, tudo bem com vc ? Espero q sim. Quanto a extensão .DOCX não tem problema, usando o ShellExecute ele abre OK, desde que vc passe o parâmetro correto... quanto a classe TWord eu fico devendo, não sei se funciona no Office 2007, pois não utilizo... um abraço Yury Marcelino Al Viman Sistemas vimansca@vimansca.com.br yury030575@yahoo.com.br (msn) skype: yury.marcelino.al Leme / SP FW 2.6 / [x]Harbour 99.50 / WS / xDev 0.65 / @say Editado por - yury on 22/02/2008 15:30:22 Quote Link to comment Share on other sites More sharing options...
supi Posted February 22, 2008 Report Share Posted February 22, 2008 Experimente tambem utilizar o START.EXE e nome do arquivo. marquivo = "Nomearq.doc" ou marquivo = "nomearq.xls" WINEXEC("START.EXE " + Marquivo ) Com isso apenas um comando ce num esquenta muito a cabeça , ... com qual versão do word etc... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.