tiagojb Posted November 22, 2013 Report Share Posted November 22, 2013 Olá pessoal, alguém saberia se é possível imprimir uma página web via ActiveX? Quote Link to comment Share on other sites More sharing options...
kapiaba Posted November 22, 2013 Report Share Posted November 22, 2013 Não sei... mas de uma olhada aqui, quem sabe... Quote Link to comment Share on other sites More sharing options...
tiagojb Posted November 22, 2013 Author Report Share Posted November 22, 2013 Kapiaba, "aqui" que você se refere seria aqui no fórum? no fórum não consegui localizar até encontrei algo sobre oActivex:print() mas, não consegui aplicar... Tentei buscar no fórum da msdn, mas também não obtive sucesso... até encontrei bastante conteudo sobre oACtiveX mas não consegui encontrar como imprimir uma webpage por ele. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted November 22, 2013 Report Share Posted November 22, 2013 Putz, perdi o link do forum inter, de uma vasculhada lá, procure por WEB. 1000 desculpas. Quote Link to comment Share on other sites More sharing options...
Eroni Posted November 22, 2013 Report Share Posted November 22, 2013 Boa tarde, se abrir a pagina pelo controle activex, use o metodo oActiveX:Do( "ExecWB", 7,1 ) que funciona, é assim que eu uso. Quote Link to comment Share on other sites More sharing options...
sistem Posted November 22, 2013 Report Share Posted November 22, 2013 ola Function AbreWebWin(cAlgo, cTitulo, oWndP, lJanela, lrestaura) Local oWndWeb, oActiveX DEFAULT lJanela := .f. DEFAULT lrestaura := .f. DEFAULT lBotao := .f. DEFAULT cAlgo := "http://www.teste.com" DEFINE WINDOW oWndWeb From 10,10 To 42,115 TITLE cTitulo oActiveX = TActiveX():New( oWndWeb, "Shell.Explorer" ) oWndWeb:oClient = oActiveX oActiveX:Do( "Navigate", cAlgo) oWndWeb:center() ACTIVATE WINDOW oWndWeb MAXIMIZED ON INIT BARRABOTOESCLI(oWndWeb, oActiveX) Return nil *------------------------------------------------------------------------------------ STATIC FUNCTION BARRABOTOESCLI(oDlg, oActiveX) Local oToolBarDlg, oImageList oImageList = TImageList():New(32,32) oImageList:AddMasked( TBitmap():Define( "BMP_PRI9",, oDlg ), nRGB( 255, 0, 255 ) ) oImageList:AddMasked( TBitmap():Define( "BMP_FLO9",, oDlg ), nRGB( 255, 0, 255 ) ) oImageList:AddMasked( TBitmap():Define( "BMP_QUIT",, oDlg ), nRGB( 255, 0, 255 ) ) DEFINE TOOLBAR oToolBarDlg OF oDlg SIZE 35,35 IMAGELIST oImageList BALLOON DEFINE TBBUTTON OF oToolBarDlg ACTION oActivex:Do("ExecWB", 7,1) TOOLTIP "Imprimir" DEFINE TBBUTTON OF oToolBarDlg ACTION oActiveX:Do("ExecWB", 4,1) TOOLTIP "Salva" DEFINE TBSEPARATOR OF oToolBarDlg DEFINE TBBUTTON OF oToolBarDlg ACTION oDlg:End() TOOLTIP "Fechar" RETURN Nil Quote Link to comment Share on other sites More sharing options...
tiagojb Posted November 25, 2013 Author Report Share Posted November 25, 2013 Obrigado pessoal, com o botão consigo fazer a impressão do Html, porém necessitaria de madar o html diretamente para a impressora sem necessidade abrir o activeX (sem o preview), seria possível? Os teste que fiz, foi tentar enviar via linha de comando porém ele imprime os códigos e não o documento html em si. Quote Link to comment Share on other sites More sharing options...
sistem Posted November 25, 2013 Report Share Posted November 25, 2013 ola Function testeimp() Local oOle oOle:= CreateObject("InternetExplorer.Application") oOle:Visible := .f. // nao apresenta o Browser oOle:Navigate2("http://www.google.com.br") WHILE oOle:Busy syswait(.3) END oOle:ExecWB(6,2) return nil fonte: http://www.tek-tips.com/viewthread.cfm?qid=1092473 Quote Link to comment Share on other sites More sharing options...
sistem Posted November 25, 2013 Report Share Posted November 25, 2013 fonte: http://www.tek-tips.com/viewthread.cfm?qid=1092473 Function testeimp() Local oOle oOle:= CreateObject("InternetExplorer.Application") oOle:Visible := .f. // nao Apresenta o Browser oOle:Navigate2("http://www.google.com.br") WHILE oOle:Busy syswait(.3) END oOle:ExecWB(6,2) return nil Quote Link to comment Share on other sites More sharing options...
tiagojb Posted November 26, 2013 Author Report Share Posted November 26, 2013 Perfeito, sistem deu certo... Aproveitando, saberia algum comando para definir o layout desta impressora, por exemplo obrigar ele imprimir em paisagem e sem os dizeres de cabeçalho e rodapé que uma pagina html traz por padrão? Quote Link to comment Share on other sites More sharing options...
tiagojb Posted November 29, 2013 Author Report Share Posted November 29, 2013 Pessoal no caso, eu necessitava imprimir em paisagem e que não imprimisse os dizeres de cabeçalho e rodape padrões do internet explorer. Resolvi com as seguintes ações: - No Internet Explorer do(s) computador(res) que farão a impressão configurei o padrão para não imprimir cabeçalho e rodapé manualmente. OK ( se alguém tiver algo via programação para fazê-lo seria interessante). - Quanto a impressão em paisagem, encontrei "comandos" CSS que permitem definir a orientação de meu html, sendo assim problema resolvido! Obrigado à todos pela ajuda. Quote Link to comment Share on other sites More sharing options...
Eroni Posted April 10, 2017 Report Share Posted April 10, 2017 fonte: http://www.tek-tips.com/viewthread.cfm?qid=1092473 Function testeimp() Local oOle oOle:= CreateObject("InternetExplorer.Application") oOle:Visible := .f. // nao Apresenta o Browser oOle:Navigate2("http://www.google.com.br") WHILE oOle:Busy syswait(.3) END oOle:ExecWB(6,2) return nil Boa tarde, revivendo o tópico, alguem saberia me dizer se esse codigo acima roda em qualquer Windows, no meu 10 está dando o erro: Código : 1001 Descrição do Erro: ================= Erro InternetExplorer.Application/0 S_OK: EXECWB Código: 1001 Detalhamento: ------------ Arg. 1 Tipo: N Valor: 6 Arg. 2 Tipo: N Valor: 2 Chamada de Pilha ================ Chamado de TOLEAUTO:EXECWB(0) Alguem já passou por isso? Quote Link to comment Share on other sites More sharing options...
kapiaba Posted April 10, 2017 Report Share Posted April 10, 2017 http://forums.fivetechsupport.com/viewtopic.php?f=3&t=27933&p=155982&hilit=ExecWB#p155982 http://forums.fivetechsupport.com/viewtopic.php?f=6&t=33835&p=200039&hilit=ExecWB#p200039 http://forums.fivetechsupport.com/viewtopic.php?f=6&t=5776&p=44347&hilit=ExecWB#p44347 Quote Link to comment Share on other sites More sharing options...
Eroni Posted April 11, 2017 Report Share Posted April 11, 2017 Resolvido, colocado mais tempo no loop enquanto o documento não carrega. 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.