Solved

Create VCard & file it away

Posted on 2013-01-30
3
614 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

914 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now