Solved

Create VCard & file it away

Posted on 2013-01-30
3
608 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
Comment Utility
a vcard is just a text file. See http://en.wikipedia.org/wiki/VCard.
0
 

Author Comment

by:correlate
Comment Utility
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
Comment Utility
Thanks for that, never realised thats all they were
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

762 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

11 Experts available now in Live!

Get 1:1 Help Now