Hola. como puedo pre definir la ruta de busqueda en cGetFile32, por ejemplo que mi carpeta de inicio de busqueda de archivos sea:
C:\Datos\Importar*.Mod
Gracias
Hola. como puedo pre definir la ruta de busqueda en cGetFile32, por ejemplo que mi carpeta de inicio de busqueda de archivos sea:
C:\Datos\Importar*.Mod
Gracias
cHasta := cGetFile32("*.Dbf","Seleccione el archivo actual de expedientes",1,".\Archivos")Gracias por responder, no fija la ruta. He notado que al seleccionar un archivo la primera vez, esta ultima ruta queda ya por default.
No he podido hacer que desde el primer intento salga en la ruta definida. Por otro lado puedo obtener solo el nombre del archivo ???, es decir sin la ruta.
Gracias
function FWSavePreviewToPDF( oDevice, cPDF, lOpen ) // oDevice can be oPrinter or oPreview
local cOrient, oPDF
local hWnd
if oDevice:IsKindOf( "TPREVIEW" )
hWnd := oDevice:oWnd:hWnd
oDevice := oDevice:oDevice
endif
#ifndef USEGDI
if LoadFreeImage() <= 32
MsgAlert( FWString( "freeimage.dll not found" ), FWString( "Alert" ) )
return nil
endif
#endif
// MODIFICADO EM: 14/03/2016 PARA SALVAR O PDF NA PASTA: C:\NFEPDF
cPRGPATH := cFILEPATH( "C:\NFEPDF\" )
lCHDIR(cPRGPATH)
// ? hb_CurDrive() + ":\" + CurDir() + "\"
DEFAULT cPDF := cGetFile( FWString( "PDF files | *.pdf |" ),;
FWString( "Select PDF File to Save" ),, ;
CurDir(), .T.,,,;
hb_CurDrive() + ":\" + CurDir() + "\" + ;
If( oDevice:IsKindOf( "TPreview" ),;
oDevice:cName, oDevice:cDocument ) + ".pdf" )
if ! Empty( cPDF )
cPDF = cFileSetExt( cPDF, "pdf" )
CursorWait()
cOrient = If( oDevice:nHorzSize() > oDevice:nVertSize(), 'L', 'P' )
oPdf = fwPdf():New( cPdf, cOrient )
AEval( oDevice:aMeta, { | cMeta | oPdf:AddMeta( cMeta ) } )
oPdf:Close()
CursorArrow()
DEFAULT lOpen := MsgYesNo( If( FWLanguageID() == 2, FWString( "¿" ) + " ", "" ) + ;
FWString( "View" ) + ;
" " + cPDF + " " + FWString( "(Y/N)" ) + " ?",;
FWString( "Please select" ) )
if lOpen
ShellExecute( IfNil( hWnd, GetWndDefault() ), "open", cPDF )
endif
else
cPDF := nil
endif
// VOLTO AO DIRETORIO DO PLENO PARA NAO QUEBRAR OS BANCOS. 14/03/2016 Joao
lCHDIR( cDirPleno )
// ? hb_CurDrive() + ":\" + CurDir() + "\"
return cPDFListo !!! si quedo, gracias. solo me falta como saber el nombre del Archivo seleccionado, sin la Ruta.
Gracias
LOCAL cNombreSinPath, cNombreSinExte
cNombreSinPath := cFileNoPath( cDbfNombre ) - cFileNoExt( cDbfNombre )
cNombreSinExte := cFileNoExt( cNombreSinPath )