GetVCard() tResult : Text[1024] // Prepare CR Characters c10 := 10; c13 := 13; ltEndline := FORMAT(c13) + FORMAT(c10); // Open vCard v2.1 tResult := 'BEGIN:VCARD' + ltEndline; tResult += 'VERSION:2.1' + ltEndline; // Name IF Type=Type::Person THEN BEGIN tResult += STRSUBSTNO('N:%1;%2;%3;%4;'+ltEndline,Surname,"First Name","Middle Name","Job Title"); // Title IF lrOrgLevel.GET("Organizational Level Code") THEN tResult += STRSUBSTNO('TITLE:%1'+ltEndline,lrOrgLevel.Description); END ELSE tResult += STRSUBSTNO('N:%1;%2;;;'+ltEndline,Name,"Name 2"); // Full Name tResult += STRSUBSTNO('FN:%1'+ltEndline,Name); // Organization/Company tResult += STRSUBSTNO('ORG:%1'+ltEndline,"Company Name"); // Phone Nos. tResult += STRSUBSTNO('TEL;WORK;VOICE:%1'+ltEndline,"Phone No."); tResult += STRSUBSTNO('TEL;WORK;FAX:%1'+ltEndline,"Fax No."); tResult += STRSUBSTNO('TEL;CELL;VOICE:%1'+ltEndline,"Mobile Phone No."); // E-Mail tResult += STRSUBSTNO('EMAIL;PREF;INTERNET:%1'+ltEndline,"E-Mail"); // URL tResult += STRSUBSTNO('URL;WORK:%1'+ltEndline,"Home Page"); // Address tResult += STRSUBSTNO('ADR;WORK;PREF:;;%1;%2;%3;%4;%5'+ltEndline,Address,City,County,"Post Code","Country Code"); // Close vCard v2.1 tResult += 'END:VCARD'+ltEndline+ltEndline;
CONTROL1104804 - OnPush() // Get some File Name ltFName := cuCDMgt.OpenFile(lTxt001,Name+'.vcf',4,lTxt002,1); IF ltFName = '' THEN EXIT; // Open Export Stream CLEAR(lfExport); lfExport.TEXTMODE(TRUE); IF NOT lfExport.CREATE(ltFName) THEN ERROR(lErr001,lrLNSetup.ToUnixPath(ltFName)); // Write it out; lfExport.WRITE(cuCDMgt.Ascii2Ansi(GetVCard)); // Close Export Stream lfExport.CLOSE;
Comments
If you open it with hyperlink, Outlook will open it automatically.
Or post a list of the variable declairation
thnx
lfExport.WRITE(cuCDMgt.Ascii2Ansi(GetVCard));
cuCDmgt = codeunit Common Dialog management , yes ?
the function Ascii2Ansi ???
And is there and import of vCard function ?
More :- Import VCF to Outlook