Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Outlook E-Mail(Create and View an Outlook E-Mail)
Outlook E-Mail [message #1085797] Tue, 13 August 2013 11:38 Go to next message
Gian-Luca Zurolo is currently offline Gian-Luca Zurolo
Messages: 1
Registered: August 2013
Junior Member
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 13:03]

Report message to a moderator

Re: Outlook E-Mail [message #1099372 is a reply to message #1085797] Sun, 01 September 2013 15:53 Go to previous message
Johan Schulz is currently offline Johan Schulz
Messages: 20
Registered: November 2010
Junior Member
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
Previous Topic:Draw SWT widget on SWT canvas
Next Topic:Struggling to get SWT_AWT bridge working on Mac with Java 7
Goto Forum:
  


Current Time: Wed Sep 24 00:37:52 GMT 2014

Powered by FUDForum. Page generated in 0.02683 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software