Solved

Create VCard & file it away

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

773 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