Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating VCD in Access

Status
Not open for further replies.

czechmate55

Technical User
Apr 12, 2010
11
US
In my form, I have a button that creates a vcd card so it can then be saved in Outlook. I am able to capture bound fields in the VCD, but I can't capture unbound fields. Do you know if it is possible to capture unbound fields or not? If it is possible, can you tell me how? here is an example of my code:

Private Sub cmdVCD_Click()
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim fs, f, ts, s

ActiveControl.Hyperlink.CreateNewDocument "C:\Temp\test.vcf", True, True

Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile("C:\Temp\test.vcf")

Set ts = f.OpenAsTextStream(ForWriting, TristateUseDefault)
ts.writeLine "begin:vcard"
ts.writeLine "fn:" & Me![Salutation] & " " & Me![FName] & " " & Me![LName] & " " & Me![Suffix]
ts.writeLine "n:" & Me![LName] & ";" & Me![FName]
ts.writeLine "org:" & Me![OrgName]

ts.writeLine "title:" & Me![Title]
ts.writeLine "tel;cell;voice:" & Me![CellPhone]
ts.writeLine "tel;work;voice:" & Me![WorkPhone] & " " & "X" & [Extension]

ts.writeLine "adr;work:;" & Me![ContAddrID]

ts.writeLine "email;internet:" & Me!
ts.writeLine "ts.write version:2.1"
ts.writeLine "End: vcard"

ts.Close

End Sub

Thank you
 
I can't capture unbound fields.
Really ?
How did you try it ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I identified each field with the Control Source. With the unbound fields, there is no control source so I don't know how to identify that field.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top