B
Der Inhalt von myfilename ist in meinem vereinfachten Programm c:\document.pdf
Die genaue Fehlermeldung währe:
Runtime Error!
Program P:\javaclient\pdrun.exe
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application´s support team for more information.
Sagt eigtl. nicht so besonders viel aus denk ich mal.
Alternativ habe ich das ganze jetzt auch mal mit der JACOB (Java COM Bridge) ausprobiert.
Dispatch mail = new Dispatch("Outlook.Application");
Dispatch mailItem = Dispatch.call(mail, "CreateItem", new Variant(0)).toDispatch();
Dispatch inspectors = Dispatch.get(mail, "Inspectors").toDispatch();
Dispatch inspector = Dispatch.call(inspectors, "Add", mailItem).toDispatch();
Dispatch.call(inspector, "Activate");
Dispatch attachments = Dispatch.get(mailItem, "Attachments").toDispatch();
Variant covOptional = new Variant();
covOptional.changeType(Variant.VariantError);
covOptional.putError(0x80020004);
Variant variant = new Variant();
variant.changeType(Variant.VariantString);
variant.putString(filename);
Dispatch.call(attachments, "Add", variant, covOptional, covOptional, covOptional);
Endet mit folgender Fehlermeldung:
Exception occurred during event dispatching:
com.jacob.com.ComFailException: Invoke of: Add
Source: Microsoft Office Outlook
Description: Die Datei "document.pdf" kann nicht erstellt werden. Klicken Sie mit der rechten Maustaste auf den Ordner, in dem Sie die Datei erstellen möchten, und klicken Sie dann auf "Eigenschaften", um Ihre Berechtigungen für den Ordner zu überprüfen.
at com.jacob.com.Dispatch.invokev(Native Method)
at com.jacob.com.Dispatch.invokev(Dispatch.java:804)
at com.jacob.com.Dispatch.callN(Dispatch.java:440)
at com.jacob.com.Dispatch.call(Dispatch.java:558)
at pdrepgen.PduiRGBuilder.sendEmailByOutlook(PduiRGBuilder.java:3295)
...
Wobei Zeile 3295 diese hier Repräsentiert:
Dispatch.call(attachments, "Add", variant, covOptional, covOptional, covOptional);
Sieht so aus als ob Outlook die PDF Datei noch mal irgendwo hinkopieren wollte und sie dort nicht erstellen könnte.
Wie gesagt, auf fast allen Rechnern hier funktioniert das ganze. Office 2k3 neuinstallation bringt auch anscheinend keine abhilfe.
P.S.: Das aufmachen des Outlookfensters hab ich im Code in meinem ersten Post mal weggelassen um das ganze ein wenig fürs Forum zu vereinfachen.