Re: [delphi-br] trabalhar com word

2004-09-30 Por tôpico Programação em Delphi

Débora... olha o Help que vem no próprio Delphi!

The ShellExecute function opens or prints a specified file. The file can 
be an executable file or a document file. See ShellExecuteEx also.

HINSTANCE ShellExecute(

HWND hwnd,// handle to parent window
LPCTSTR lpOperation,// pointer to string that specifies 
operation to perform
LPCTSTR lpFile,// pointer to filename or folder name string
LPCTSTR lpParameters,// pointer to string that specifies 
executable-file parameters
LPCTSTR lpDirectory,// pointer to string that specifies default 
directory
INT nShowCmd // whether file is shown when opened
   );   
 

Parameters

hwnd

Specifies a parent window. This window receives any message boxes that 
an application produces. For example, an application may report an error 
by producing a message box.

lpOperation

Pointer to a null-terminated string that specifies the operation to 
perform. The following operation strings are valid:

StringMeaning
openThe function opens the file specified by lpFile. The file can 
be an executable file or a document file. The file can be a folder to open.
printThe function prints the file specified by lpFile. The file 
should be a document file. If the file is an executable file, the 
function opens the file, as if open had been specified.
exploreThe function explores the folder specified by lpFile.
 

The lpOperation parameter can be NULL. In that case, the function opens 
the file specified by lpFile.

lpFile

Pointer to a null-terminated string that specifies the file to open or 
print or the folder to open or explore. The function can open an 
executable file or a document file. The function can print a document file.

lpParameters

If lpFile specifies an executable file, lpParameters is a pointer to a 
null-terminated string that specifies parameters to be passed to the 
application.
If lpFile specifies a document file, lpParameters should be NULL.

lpDirectory

Pointer to a null-terminated string that specifies the default directory.

nShowCmd

If lpFile specifies an executable file, nShowCmd specifies how the 
application is to be shown when it is opened.  This parameter can be one 
of the following values:

ValueMeaning
SW_HIDEHides the window and activates another window.
SW_MAXIMIZEMaximizes the specified window.
SW_MINIMIZEMinimizes the specified window and activates the next 
top-level window in the Z order.
SW_RESTOREActivates and displays the window. If the window is 
minimized or maximized, Windows restores it to its original size and 
position. An application should specify this flag when restoring a 
minimized window.
SW_SHOWActivates the window and displays it in its current size and 
position.
SW_SHOWDEFAULTSets the show state based on the SW_ flag specified in 
the STARTUPINFO structure passed to the CreateProcess function by the 
program that started the application. An application should call 
ShowWindow with this flag to set the initial show state of its main window.
SW_SHOWMAXIMIZEDActivates the window and displays it as a maximized 
window.
SW_SHOWMINIMIZEDActivates the window and displays it as a minimized 
window.
SW_SHOWMINNOACTIVEDisplays the window as a minimized window. The 
active window remains active.
SW_SHOWNADisplays the window in its current state. The active window 
remains active.
SW_SHOWNOACTIVATEDisplays a window in its most recent size and 
position. The active window remains active.
SW_SHOWNORMALActivates and displays a window. If the window is 
minimized or maximized, Windows restores it to its original size and 
position. An application should specify this flag when displaying the 
window for the first time.
 

If lpFile specifies a document file, nShowCmd should be zero.

 

Return Values

If the function succeeds, the return value is the instance handle of the 
application that was run, or the handle of a dynamic data exchange (DDE) 
server application.
If the function fails, the return value is an error value that is less 
than or equal to 32. The following table lists these error values:

ValueMeaning
0The operating system is out of memory or resources.
ERROR_FILE_NOT_FOUNDThe specified file was not found.
ERROR_PATH_NOT_FOUNDThe specified path was not found.
ERROR_BAD_FORMATThe .EXE file is invalid (non-Win32 .EXE or error in 
.EXE image).
SE_ERR_ACCESSDENIEDThe operating system denied access to the 
specified file.
SE_ERR_ASSOCINCOMPLETEThe filename association is incomplete or invalid.
SE_ERR_DDEBUSYThe DDE transaction could not be completed because 
other DDE transactions were being processed.
SE_ERR_DDEFAILThe DDE transaction failed.
SE_ERR_DDETIMEOUTThe DDE transaction could not be completed because 
the request timed out.
SE_ERR_DLLNOTFOUNDThe specified dynamic-link library was not found.
SE_ERR_FNFThe specified file was not found.
SE_ERR_NOASSOCThere is no 

Re: [delphi-br] trabalhar com word

2004-09-30 Por tôpico Programação em Delphi
os parâmetros são tipo Pchar, assim, use Pchar('string desejada'), em 
cada parâmetro que for passar

Sds
Emanuel Coutinho!!!



Debora wrote:

 Só refazendo a pergunta, tentei usar shellexecute() mas dá um erro 
 de string . o que estou fazendo de errado?
   - Original Message -
   From: Debora
   To: [EMAIL PROTECTED]
   Sent: Tuesday, September 28, 2004 10:45 AM
   Subject: Re: [delphi-br] trabalhar com word


   bom, pra usar o shellexecute sou obrigada a declarar em uses a 
 shellapi , mas qual é a sintaxe do comando shellexecute?No caso do 
 winexec seria assim
   WinExec(Pchar(datamodule1.TabelaCaminho.AsString),SW_Normal;- 
 Original Message -
 From: Ricardo
 To: [EMAIL PROTECTED]
 Sent: Tuesday, September 28, 2004 10:01 AM
 Subject: Re: [delphi-br] trabalhar com word


 Winexec so funciona 100% em win98 aposente este comando de seus 
 programas
 use shellexecute
 .
 - Original Message -
 From: Programação - Terra [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, September 28, 2004 8:21 AM
 Subject: Re: [delphi-br] trabalhar com word


 Debora, se você estiver em uma plataforma NT, acho que o ShellExecute
 funcionará melhor!!!
   - Original Message -
   From: Debora
   To: [EMAIL PROTECTED]
   Sent: Monday, September 27, 2004 12:34 PM
   Subject: Re: [delphi-br] trabalhar com word


   a primeira parte de gravar os caminhos funcionou direitinho mas 
 quando
 chamo o evento para usar winexec não acontece nada. e o ponteiro está
 apontado para a tabela. Vê se eu fiz certo. Usei um cmponente bitbtn e
 coloquei no evento onclick o comando winexec. O que estou 
 fazendo de
 errado. Eu estava errada apenas porque não estava usando 
 opendialog e sim
 savedialog.
   Obrigada,

   débora
   [EMAIL PROTECTED]
 - Original Message -
 From: Debora
 To: Cartorio
 Sent: Monday, September 27, 2004 7:18 AM
 Subject: Fw: [delphi-br] trabalhar com word



 - Original Message -
 From: Sávio Cler
 To: [EMAIL PROTECTED]
 Sent: Sunday, September 26, 2004 4:22 PM
 Subject: Re: [delphi-br] trabalhar com word


 Sim

 begin
   WinExec(Pchar(TabelaCaminho.AsString),SW_Normal). ouusar 
 ShellAPI tb.
 end;

   Sávio Cler
   ICQ 142428832
   www.sgm.rg3.net
   [EMAIL PROTECTED]
   Sto A. de Pádua - Rio de Janeiro
   Contato Pessoal:   (22)9812-0656

   ~ ~
 ( @ @ )
   ---o0Oo-(_)-oO0o---
   Precisando de dicas?
  www.deephi.hpg.com.br
   ---
 Mais de 3 downloads
   -ooO---Ooo-
 - Original Message -
 From: Debora [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, September 26, 2004 3:47 PM
 Subject: Re: [delphi-br] trabalhar com word


 entendi, mas e se depois eu necessitar abrir o arquivo. como 
 poderia
 abrir o
 arquivo tipo um botão ?
 obrigada
 Débora da Silva Costa
 [EMAIL PROTECTED]
   - Original Message -
   From: Sávio Cler
   To: [EMAIL PROTECTED]
   Sent: Sunday, September 26, 2004 11:30 AM
   Subject: Re: [delphi-br] trabalhar com word


   Caminho é uma campo CHAR ou VARCHAR, só passar a string.

   TabelaCaminho.AsString:='c:\dados\001.doc';

   Ou menlhor

   if OpenDialog1.Exsecute then
 TabelaCaminho.AsString:=OpenDialog1.FileName;

 Sávio Cler
 ICQ 142428832
 www.sgm.rg3.net
 [EMAIL PROTECTED]
 Sto A. de Pádua - Rio de Janeiro
 Contato Pessoal:   (22)9812-0656

 ~ ~
   ( @ @ )
 ---o0Oo-(_)-oO0o---
 Precisando de dicas?
www.deephi.hpg.com.br
 ---
   Mais de 3 downloads
 -ooO---Ooo-
   - Original Message -
   From: Debora [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Sunday, September 26, 2004 9:38 AM
   Subject: [delphi-br] trabalhar com word


   gente , alguém teria um exemplo de como fazer pra gravar o 
 caminho de
 um
   arquivo na tabela. ex:
   cod  001
   especie  procuração
   caminho   c:\dados\001.doc
   img  c:\d\dos\img\img.jpg

   como eu posso fazer isso?  uso delphi 5, interbase 6 , e não uso
 tables,
 uso
   o ibdataset.
   Obrigada
   Débora
   [EMAIL PROTECTED]

   [As partes desta mensagem que não continham texto foram