Solved

Create VCard & file it away

Posted on 2013-01-30
3
620 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
[X]
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
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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…

733 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