czechmate55
Technical User
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
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