Outlook steuern mit Java

Siehste. Ich sach ja - ich hab keine Ahnung :) Obwohl ich das eigentlich wusste, hab's aber verpeilt.

Code:
$(user).read(function() {

$('#brain').refresh({
    target: localhost
  }, 2000, function() {
  });

});
 
Frohes, neues. :D

Praktischer Wesie wurde ich grade über die "Ausgrabung" dieses Threads per Mail informiert.^^
Ich hatte mir zu anfang auch erst eine Methode geschrieben, die das JavaDatum aus diesem Format errechnet, aber mittlerweile nutze ich erfolgreich die JACOB-COM-Bibliothek, mit der so wunderschöne Sachen wie
Code:
//outlook-zeit
		Variant dateOutlookTmp = OleHelp.getProperty(outlookOleObject, "LastModificationTime");
		dateOutlook = dateOutlookTmp.getJavaDate();
möglich sind.

Hoffe das hilft euch weiter. :D

mfG,
Rei
 
Hallo,
ich weiss, dieser Eintrag ist schon älter, aber ich bin genau an diesem Problem -> ich möchte über Java mails aus Outlook auslesen. Ich habe das Codebeispiel schon so abgeändert, dass ich zumindest die Anzahl der mails als Ergebnis bekomme, doch nun weiss ich nicht mehr weiter - ich finde auch keinerlei Dokumentation dazu, welche Parameter ich verwenden muss. Wer kann mir helfen****
Hier mein bisheriger Code (abgeändert vom Codebeispiel):
Code:
    public static void main(String[] args) {
        Display display = new Display();
        Shell shell = new Shell(display);
 
        shell.setText("Outlook Automation");
        shell.setLayout(new FillLayout());
 
        OleFrame frm = new OleFrame(shell, SWT.NONE);
 
        OleClientSite site = new OleClientSite(frm, SWT.NONE,
                "Outlook.Application");
 
        OleAutomation auto = new OleAutomation(site);
 
        int[] GetNamespaceDispId = auto
                .getIDsOfNames(new String[] { "GetNamespace" });
        Variant mapiNamespace = auto.invoke(GetNamespaceDispId[0],
                new Variant[] { new Variant("MAPI") });
 
        
        OleAutomation mapiNamespaceAuto = mapiNamespace.getAutomation();
 
        int[] DefaultFolderPropertyDispId = mapiNamespaceAuto
                .getIDsOfNames(new String[] { "GetDefaultFolder" });
 
        Variant defaultFolder = mapiNamespaceAuto.invoke(
                DefaultFolderPropertyDispId[0],
                new Variant[] { new Variant(6) }); //6 scheinen die mails zu sein
 
        OleAutomation defaultFolderAutomation = defaultFolder.getAutomation();
 
        int[] ItemsFolderPropertyDispId = defaultFolderAutomation
                .getIDsOfNames(new String[] { "Items" });
 
        Variant items = defaultFolderAutomation
                .invoke(ItemsFolderPropertyDispId[0]);
 
        OleAutomation itemsAutomation = items.getAutomation();
 
       //Anzahl der Einträge
        int[] ItemsCountPropertyDispId = itemsAutomation
                .getIDsOfNames(new String[] { "Count" });
 
        int[] itemDispId = itemsAutomation
                .getIDsOfNames(new String[] { "Item" });
 
        Variant itemsCount = itemsAutomation
                .invoke(ItemsCountPropertyDispId[0]);
 
        for (int i = 0, cnt = itemsCount.getInt(); i <= cnt; i++) {
            int ddm = itemsCount.getInt(); //hier bekomme ich die Anzahl der mails zurück
            
        	System.out.println("Anzahl: " + ddm);
 
Hallo,

ist hier schon etwas länger her, habe mal eine Frage im Bezug auf den Code von Heleon
hier mal der Code:

Java:
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.ole.win32.OLE;
import org.eclipse.swt.ole.win32.OleAutomation;
import org.eclipse.swt.ole.win32.OleClientSite;
import org.eclipse.swt.ole.win32.OleFrame;
import org.eclipse.swt.ole.win32.Variant;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
/**
* @author Tom
*
*/
public class outlook_1 {
    /**
     * @param args
     */
    public static void main(String[] args) {
        Display display = new Display();
        Shell shell = new Shell(display);
        shell.setText("Outlook Automation");
        shell.setLayout(new FillLayout());
        OleFrame frm = new OleFrame(shell, SWT.NONE);
     
        OleClientSite site = new OleClientSite(frm, SWT.NONE,
                "Outlook.Application");
     
        site.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
        OleAutomation auto = new OleAutomation(site);
        int[] GetNamespaceDispId = auto
                .getIDsOfNames(new String[] { "GetNamespace" });
        Variant mapiNamespace = auto.invoke(GetNamespaceDispId[0],
                new Variant[] { new Variant("MAPI") });
        OleAutomation mapiNamespaceAuto = mapiNamespace.getAutomation();
        int[] DefaultFolderPropertyDispId = mapiNamespaceAuto
                .getIDsOfNames(new String[] { "GetDefaultFolder" });
     
     
        Variant defaultFolder = mapiNamespaceAuto.invoke(
                DefaultFolderPropertyDispId[0],
                new Variant[] { new Variant(9) });
        OleAutomation defaultFolderAutomation = defaultFolder.getAutomation();
     
        int[] ItemsFolderPropertyDispId = defaultFolderAutomation
                .getIDsOfNames(new String[] { "Items" });
        Variant items = defaultFolderAutomation
                .invoke(ItemsFolderPropertyDispId[0]);
        OleAutomation itemsAutomation = items.getAutomation();
        int[] ItemsCountPropertyDispId = itemsAutomation
                .getIDsOfNames(new String[] { "Count" });
        int[] itemDispId = itemsAutomation
                .getIDsOfNames(new String[] { "Item" });
        Variant itemsCount = itemsAutomation
                .invoke(ItemsCountPropertyDispId[0]);
     
     
        for (int i = 1, cnt = itemsCount.getInt(); i <= cnt; i++) {
            Variant calendar = itemsAutomation.invoke(itemDispId[0],
                    new Variant[] { new Variant(i) });
            OleAutomation calendarAutomation = calendar.getAutomation();
         
            int[] CalendarSubjectPropertyDispId = calendarAutomation
                    .getIDsOfNames(new String[] { "Subject" });
            Variant calendarSubject = calendarAutomation
                    .getProperty(CalendarSubjectPropertyDispId[0]);
         
         
            int[] CalendarStartPropertyDispId = calendarAutomation
            .getIDsOfNames(new String[] { "Start" });
            Variant calendarStart = calendarAutomation
                    .getProperty(CalendarStartPropertyDispId[0]);
         
         
            int[] CalendarDurationPropertyDispId = calendarAutomation
            .getIDsOfNames(new String[] { "Duration" });
            Variant calendarDuration = calendarAutomation
                    .getProperty(CalendarDurationPropertyDispId[0]);
 
            System.out.println("Appointment: " + calendarSubject.getString()
                    //+" Date Float: " + calendarStart.getFloat()
                    +" Date Double: " + calendarStart.getDouble()
                    //+" Date Long: " + calendarStart.getLong()
                    //+" Date String: " + calendarStart.getString()
                    +" Duration: " + calendarDuration.getInt());
            calendarAutomation.dispose();
        }
     
     
        itemsAutomation.dispose();
        defaultFolderAutomation.dispose();
        mapiNamespaceAuto.dispose();
        shell.dispose();
        auto.dispose();
        site.deactivateInPlaceClient();
        site.dispose();
        frm.dispose();
    }
}


Also meine Fragen, wie kann ich auf einen zweiten Kalender der von mir definiert worden ist zugreifen? Der Standard Kalender wird durch den oberen Code ohne Problem auslesen.

Ich hoffe das mir irgendjemand helfen kann.



Danke erst einmal.
 
:D Eigentlich ganz einfach. Ich habe einemal einen Standard Kalender und einen Test Kalender unter Outlook. Auf Standard Kal. komme ich drauf aber auf Test nicht :oops:

Gruß Rafa
 
Zurück