OK Rob, I understand. I only meant to infer that I would be
testing my hypotheses to ensure it was correct. Not wishing to sound boastful, but it was and the simple example I was going to post was this;
public class OutlookTest {
private ActiveXComponent oleComponent = null;
private Dispatch activeDoc = null;
private final static
String APP_ID = "Outlook.Application.12";
public OutlookTest(boolean visibility) {
//this.oleComponent = ActiveXComponent.connectToActiveInstance(OutlookTest.APP_ID);
this.oleComponent = new ActiveXComponent(OutlookTest.APP_ID);
//this.oleComponent.setProperty("Visible", new Variant(visibility));
}
public void createContact() {
Dispatch disp = null;
Variant var = null;
Object[] args = null;
args = new Object[]{2};
var = Dispatch.call(this.oleComponent, "CreateItem", args);
System.out.println(var);
disp = var.getDispatch();
Dispatch.put(disp, "FullName", "Contact's Full Name");
Dispatch.put(disp, "CompanyName", "Company Name.");
Dispatch.put(disp, "JobTitle", "The Boss");
// Show the contact for de-bugging purposes.
Dispatch.call(disp, "Display");
}
/**
* Called once processing has completed in order to close down the instance
* of
Word.
*/
public void quit() {
Dispatch.call(this.oleComponent, "Quit");
this.oleComponent.safeRelease();
}
}
The other members, properties, etc of the ContactItem can be read from here -
http://msdn.microsoft.com/en-us/library/office/ff868407.aspx