Skip to main content
Participating Frequently
February 9, 2010
Question

Is it possible to open a Outlook vCard from Flash?

  • February 9, 2010
  • 2 replies
  • 861 views

I have a button that when clicked "should" open a vCard from Outlook 2007. Is this possible using AS2 and if so, what would the code be?

Thanks.

This topic has been closed for replies.

2 replies

Inspiring
March 12, 2010

Hi, i just realized that vCards are just ordinary text files with an extension of ".vcf" that contain plain text content similar as the following text:


BEGIN:VCARD
VERSION:2.1
SOURCE:Yahoo! AddressBook (http://address.yahoo.com)
PRODID:-//Yahoo!/AddressBook/YAB3/2010
FN;CHARSET=utf-8:Harry Roland Kunz
N;CHARSET=utf-8:Kunz;Harry Roland;;;
EMAIL;INTERNET;PREF;CHARSET=utf-8:harryrolandkunz@yahoo.com
UID;CHARSET=utf-8:556ded4603cf1ef789bead6c3c5f114f
X-CID;CHARSET=utf-8:16777388
X-CREATED;CHARSET=utf-8:1266555402
X-MODIFIED;CHARSET=utf-8:1266555413
REV;CHARSET=utf-8:292
X-PRIMARY-PHONE;CHARSET=utf-8:0
END:VCARD

BEGIN:VCARD
VERSION:2.1
SOURCE:Yahoo! AddressBook (http://address.yahoo.com)
PRODID:-//Yahoo!/AddressBook/YAB3/2010
FN;CHARSET=utf-8:Harry Kunz
N;CHARSET=utf-8:Kunz;Harry;;;
EMAIL;INTERNET;PREF;CHARSET=utf-8:Name@somedomain.com
UID;CHARSET=utf-8:38a6e0c55aaa550e914b3f59377abd16
X-CID;CHARSET=utf-8:16777391
X-CREATED;CHARSET=utf-8:1266593012
X-MODIFIED;CHARSET=utf-8:1266593021
REV;CHARSET=utf-8:297
X-PRIMARY-PHONE;CHARSET=utf-8:0
END:VCARD
This is an example of 2 contact information. You can load it using the native XML class (but that may not be the best way) with a code like:
var cXml:Object = new XML();
cXml.onLoad = function(fSuccess:Boolean)
{
   trace(fSuccess);
   trace(cXml);
}
cXml.load("vCard.vcf");
And then do a string search for "BEGIN" and count how many matches of contacts are in the file (in case it is more than one). But i would suggest you better convert the vCard content to an XML standardized file so that it's easier to parse with the standard methods available today. You could do that by for example:
<?xml version="1.0" encoding="UTF-8"?>
<vcard>
   <contact id="1">
      <lastname>John</lastname>
      <firstname>TheBaptist</firstname>
      <email>john@baptist.com</email>
   </contact>
   <contact id="2">
      <lastname>Craig</lastname>
      <firstname>David</firstname>
      <email>craig@baptist.com</email>
   </contact>
</vcard>

Participating Frequently
March 12, 2010

Excellent!!! Thank you so very much. I shall be excited to try it out.

Inspiring
March 12, 2010

You're welcome.

Inspiring
February 12, 2010

I don't think ActionScript supports any APIs that can do that.