Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
6
Erster Beitrag:
vor 2 Jahren, 8 Monaten
Letzter Beitrag:
vor 2 Jahren, 8 Monaten
Beteiligte Autoren:
Allard, DW, Paulo Oliveira, Fabrice Harari

shell execute

Startbeitrag von Allard am 28.09.2015 14:49

Hi.

I have a pdf thatis saved in hyperfile cs. I would like to open that pdf.

So I Added it to a table and dit a shell execute on the table . This didnot work. Then I tried This:

IF HReadSeekFirst(Verzonden_Email_bijlagen,Verzonden_Email_bijlagenID,TABLE_bijlagen.COL_ID) THEN
ShellExecute(Verzonden_Email_bijlagen.Bijlage)
END

I looksup the pdf and then does a shell excute on the found item. This doesnot work as well

Anybody an I dea how to get this? Do I have to save the item first as a file ?


regards

Allard

Antworten:

as far i know yes.

von Paulo Oliveira - am 28.09.2015 14:56
Ok

Anyone an Idea how to do this. Have been lookingin the help but cannot find it

regards

Allard

von Allard - am 28.09.2015 15:26
Hello Allard,

yes and no...

if you really want to display it in an external application, then yes, with hextractmemo
buf if you are ready to display your pdf internally, there is an example in windev (pdf viewer or something like that), then you should be able to just display it by doing Img_Field=File.BinaryMemoField

Best regards

von Fabrice Harari - am 28.09.2015 16:11
Hello Allard

//We will send the file to the temp folder
sTempFolder is string = fTempPath()


//Get the record from the DB
IF HReadSeekFirst(DOCUMENT_STORAGE,Document_ID,nDocID) THEN
sFileName is string = DOCUMENT_STORAGE.File_Name
else
ReturnToCapture()
end

sFileToOpen is string = sTempFolder+sFileName

IF NOT HExtractMemo(DOCUMENT_STORAGE,Document,sFileToOpen) THEN
Info("The Document could not be extracted from the file try again!")
ReturnToCapture()
END

//Test the temp location to make sure it is there
IF NOT fFileExist(sFileToOpen) THEN
//give it a few seconds to check
Multitask(200)
END

//The memo was extracted now open it.
IF ShellExecute(sFileToOpen) THEN
//Do other things here
End




I do 2 a couple of other things.(Code removed to make it easier to read)
1) I create a copy and then compare the 2 documents for changes, If they are different then I ask the user to save the changed documnet.
2) Delete the pdf's from the temp file.

Good luck

DW

von DW - am 28.09.2015 18:13
Thanks DW for the coding!!

I came up with something similar:

The code:


IF HReadSeekFirst(Verzonden_Email_bijlagen,Verzonden_Email_bijlagenID,TABLE_bijlagen.COL_ID) = True THEN
sMemoinfo is string
sMemoinfo = HInfoMemo(Verzonden_Email_bijlagen,Bijlage)
IF sMemoinfo = "" THEN
RESULT = False
ELSE

sFilename, sBestand is string = fExtractPath(ExtractString(sMemoinfo,2,TAB), fFileName + fExtension)
sFilename = fTempPath() + sBestand

IF fFileExist(sFilename) THEN
sFilename = fTempPath() + GetGUID(guidRough ) + Verzonden_Email_bijlagen.Omschrijving
END



IF NOT HExtractMemo( Verzonden_Email_bijlagen,Bijlage,sFilename)THEN
//IF NOT HExtractMemo(Documenten,Document,sFilename) THEN
Info( "Er gaat iets fout.")
ELSE
RESULT = False

END

// error ( "Tijdelijk bestand kanniet worden gemaakt omdat deze op een andere plaats wordt gebruikt")
//return
//end

ShellExecute(sFilename,"open")
// IF NOT fTrackFile(sFilename, ProcessModification , ftModifyFile ) THEN
// Info("The " + sFilename + " file will not be tracked.")
// END
//fDelete(sFilename,frReadOnly)
END
ELSE

END

von Allard - am 28.09.2015 20:21
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.