![]() |
ISAP -> DOC to PDF -> CreateOleObject('Word.Application') funktioniert nicht
Hallo,
meine ISAP Anwendung (um ein bestehendes Word-DOC in ein PDF umzuwandeln) funktioniert nicht. Ich vermute - es hängt damit zusammen dass die ISAPI vom Apache mit "Loakes System" ausgeführt wird? Wenn ja - wie kann ich ein "CreateOleObject As Admin" oder so ähnlich ausführen? -- oder irgedwie anders ein Word-Doc in ein PDF konverteiren? Den Apach Dienst am Server darf ich nicht als anderen User ausführen Danke für Hinweise Erich Hier mein Code: Uses Comobj, Varianst Vars: WordAllication und WordFile : OLEVariant;
Code:
WordApplication := Null;
WordFile := Null; try // create Word OLE try // Check if Word is already opened? WordApplication := GetActiveOleObject('Word.Application' ); except try WordApplication := CreateOleObject('Word.Application' ); WordApplication.Visible := true; except Exception.Create( 'Error' ); end; end; except WordApplication := Null; end; If VarIsNull( WordApplication ) = False then begin try WordApplication.Visible := true; // set to False if you do not want to see the activity in the background WordApplication.DisplayAlerts := true; // ensures message dialogs do not interrupt the flow of your automation process. May be helpful to set to True during testing and debugging. // Open Word File try WordFile := WordApplication.Documents.Open(merge_dateiname_mit_pfad ); except WordFile := Null; end; If VarIsNull( WordFile ) = False then begin WordFile.SaveAs2( merge_destfolder + '\aenderung' + UniMainModule.Z_AENDERUNG.FieldByName( 'Reportnummer' ).AsString + '\converted.pdf', 17 ); // wdFormatPDF = 17 end else begin showtoast('Word-Dokument konnte nicht konvertiert werden'); end; finally WordFile.Close; WordApplication.DisplayAlerts := true; WordApplication.Quit; WordFile := Unassigned; WordApplication := Unassigned; end; end else begin showtoast('Word konnte nicht gestartet werden'); end; |
AW: ISAP -> DOC to PDF -> CreateOleObject('Word.Application') funktioniert nicht
Es gibt ganz bestimmt auch Konvertierungsprogramme von irgendwelchen anderen Herstellern.
![]() Du könntest versuchen die Registrierung in die Registry dieses System-Nutzers zu kopieren, bzw. das COM-/ActiveX-Control manuell aufzurufen (DLL selbst laden usw.) oder das Konvertieren mit einem zweiten Service/Programm in einem anderen Nutzerkontext ausführen und z.B. via IPC miteinander reden, bzw. CreateProcessAsUser oder Dergleichen. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:11 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz