You need to sign in to do that
Don't have an account?

Can I control the mime-type of the S-Control Window?
I'd like to write an s-control using the Ajax toolkit but I’d like the window that
opens up to be of a specific mime (sub) type!
Not HTML!!!! Can this be done?
Thx in advance,
http://www.salesforce.com/us/developer/docs/pages/index_CSH.htm#pages_styling_content_type.htm
Looks like VisualForce will take care of this...- create a page with the code below / set security properly... assume name: Contact_vCard
- create/add a custom link (or button) on contact page layout (I used open New Window): /apex/Contact_vCard?id={!Contact.Id}
Code:<apex:page standardController="Contact" contenttype="text/x-vcard">
BEGIN:VCARD
VERSION:2.1
N:{!Contact.LastName};{!Contact.FirstName}
FN:{!Contact.FirstName} {!Contact.LastName}
ORG:{!Contact.Account.Name}
TITLE:{!Contact.Title}
TEL;WORK;VOICE:{!Contact.Phone}
TEL;WORK;FAX:{!Contact.Fax}
TEL;WORK;Cell:{!Contact.MobilePhone}
TEL;HOME;VOICE:{!Contact.HomePhone}
ADR;WORK:;;{!Contact.MailingStreet};{!Contact.MailingCity};{!Contact.MailingState};{!Contact.MailingPostalCode};{!Contact.MailingCountry}
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:{!Contact.MailingStreet}=0D=0A{!Contact.MailingCity}, {!Contact.MailingState} {!Contact.MailingPostalCode}=0D=0A{!Contact.MailingCountry}
EMAIL;PREF;INTERNET:{!Contact.Email}
NOTE;ENCODING=QUOTED-PRINTABLE:Exported from -->Organization Name<-- salesforce.com CRM application=0D=0A*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*=0D=0A{!Contact.Description}
END:VCARD
</apex:page>
Apologies for bumping this, but I have recreated the VF page and link as per instruction within the thread, however when clicking link, I get the following error:
"Internet Explorer cannot download Contact_vcard from c.eu0.visual.force.com.
Internet Explorer was not able to open this internet site. The requested site is either unavailable or cannot be found. Please try again later."
Does anyone have any ideas?
I was also checking into an option to create v-cards, and after some digging, found the following information in the help guides:
So for testing purposes, I used my User First Name and Last Name to create a test vcard with the following code:
<apex:page standardController="User" showHeader="False" cache="True" contenttype="text/x-vcard#TempImport.vcf">
BEGIN:VCARD
VERSION:2.1
FN:{!$User.FirstName} {!$User.LastName}
END:VCARD
</apex:page>
This code worked for me, and I was able to download the v-card. (I am using Windows XP Pro and Office 2007). Hope this helps!