Outlook E-Mail [message #1085797] |
Tue, 13 August 2013 07:38  |
Eclipse User |
|
|
|
Hi there,
I'm searching the web for days now, without finding a solution.
I want to create an E-Mail for Outlook (2013) and set it up (body, subject, etc)
This E-Mail should then get visible for the user, so he can click send manually.
I have x64 (java, os and swt 4.3 downloaded from eclipse)
But i can't get this code to work:
public class Main {
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");
}
}
Exception in thread "main" org.eclipse.swt.SWTException: Failed to create Ole Client. result = -2147221164
at org.eclipse.swt.ole.win32.OLE.error(OLE.java:302)
at org.eclipse.swt.ole.win32.OleClientSite.<init>(OleClientSite.java:242)
at outlooktest.Main.main(Main.java:27)
The error occurs when I want to create the OleClientSite. With Outlook.Application it doesn't work. With Excel.Sheet or Word.Document it works.
[Updated on: Tue, 13 August 2013 09:03] by Moderator
|
|
|
Re: Outlook E-Mail [message #1099372 is a reply to message #1085797] |
Sun, 01 September 2013 11:53  |
Eclipse User |
|
|
|
Hi,
maybe this link can help you.
It seems you have to start outlook first before you can access it with OleClientSide.
Im not sure but i think you will need an 64bit Outlook instance if you use it with an 64bit SWt lib.
Johan
|
|
|
Powered by
FUDForum. Page generated in 0.02787 seconds