Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Create VCard & file it away

Posted on 2013-01-30
3
618 Views
Last Modified: 2013-02-01
Dear Experts,

How can I create a vcard from Access with out saving the object in outlook?

I basically want to save the v-card in a folder for use later on rather than having the contact added to my outlook.

These will get saved in "C:\Users\Public\Documents\Marketing Collateral"

Can anybody help?
0
Comment
Question by:correlate
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
ramrom earned 500 total points
ID: 38841333
a vcard is just a text file. See http://en.wikipedia.org/wiki/VCard.
0
 

Author Comment

by:correlate
ID: 38843461
Thanks for the tip - have managed to crack it - code below

Function PrintVCard(vcInfo As String, flName As String)
    Open flName For Output As #1    ' Open file for output.
    Print #1, vcInfo
    Close #1
End Function
Private Sub GenerateVCard_Click()

Dim MobileString4Vcard As String
Dim DLString4Vcard As String

If Me.[Card-Mobile Y/N] = True Then
MobileString4Vcard = ""
Else
MobileString4Vcard = Me.[Gen-Mobile]
End If

If Me.[Card-Directline Y/N] = True Then
DLString4Vcard = Me.[Card-Switchboard]
Else
DLString4Vcard = Me.[Gen-DirectLine]
End If


Dim flName As String

flName = Application.CurrentProject.Path & Me.[Fold-General] & "\" & Me.[Gen-FullName] & ".vcf"
Dim vcInfo As String
vcInfo = "BEGIN:VCARD" & vbCrLf
vcInfo = vcInfo & "VERSION: 3.0" & vbCrLf
vcInfo = vcInfo & "N: " & Me.[Gen-LastName] & ";" & Me.[Gen-FirstName] & vbCrLf
vcInfo = vcInfo & "FN:" & Me.[Gen-FirstName] & " " & Me.[Gen-LastName] & vbCrLf
vcInfo = vcInfo & "ORG:XXXXXXX" & vbCrLf
vcInfo = vcInfo & "TITLE:" & Me.[Gen-JobTitle] & vbCrLf
vcInfo = vcInfo & "TEL;TYPE=WORK,VOICE: " & DLString4Vcard & vbCrLf
vcInfo = vcInfo & "TEL;TYPE=CELL,VOICE: " & MobileString4Vcard & vbCrLf
vcInfo = vcInfo & "URL;WORK:" & Me.[CardURL2] & vbCrLf
vcInfo = vcInfo & "ADR;TYPE=WORK:;; " & Me.[Card-VOffice Address] & vbCrLf
vcInfo = vcInfo & "EMAIL;PREF;INTERNET:" & Me.[Gen-WorkEmail] & vbCrLf
vcInfo = vcInfo & "END:VCARD"
Call PrintVCard(vcInfo, flName)
End Sub

Open in new window

0
 

Author Closing Comment

by:correlate
ID: 38843465
Thanks for that, never realised thats all they were
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question