aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Microsoft.Outlook jacob-1.17-M2-x86.dll Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Microsoft.Outlook jacob-1.17-M2-x86.dll" Watch "Microsoft.Outlook jacob-1.17-M2-x86.dll" New topic
Author

Microsoft.Outlook jacob-1.17-M2-x86.dll

Imre Tokai
Ranch Hand

Joined: Jun 04, 2008
Posts: 130
Hello,

How to create contact card in Outlook via jacob-1.17-M2-x86.dll
Have been trying combination of below commands, but no success, for now http://www.land-of-kain.de/docs/jacob/

Any idea?

Regards
Mark Beardsley
Ranch Hand

Joined: Jun 07, 2013
Posts: 32
    
    1
Libraries such as Jacob really allow you to 'translate' the VBA code used to create macros into Java. So, first take a look here - http://msdn.microsoft.com/en-us/library/office/aa210907%28v=office.11%29.aspx - and scroll down to the VBA example which looks like this;

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olContactItem)

This tells you that to crate a new contact, you need an object that refers to the Outlook application and then call the CreateItem() method on this object passing it the correct value to yield a new contact. This value is 2 I think but you can find out by digging around in the Oulook Object Model.

If I have the time, I will try to put together the Jacob code but cannot promise qwhen this will be.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19759
    
  20

Mark, although the offer is generous, please DontBeACodeMill. If you provide full answers, Imre will not learn a thing.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Mark Beardsley
Ranch Hand

Joined: Jun 07, 2013
Posts: 32
    
    1
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Microsoft.Outlook jacob-1.17-M2-x86.dll