码迷,mamicode.com
首页 > 其他好文 > 详细

20180821ImportContactFromExcel

时间:2018-08-21 22:39:02      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:list()   card   close   ring   iphone   highlight   rac   文件   from   

Excel创建vcf文件,借助百度云助手导入Iphone6Plus

Sub CreateContractList() Set Wb = Application.ThisWorkbook FilePath = Wb.Path & "\班级通讯录.txt" Set Sht = Wb.Worksheets("处理") With Sht EndRow = .Cells(.Cells.Rows.Count, 1).End(xlUp).Row For i = 2 To EndRow ThisOne = "BEGIN:VCARD" & vbCr & _ "VERSION:3.0" & vbCr & _ "FN: " & "Class12" & .Cells(i, 2).Value & vbCr & _ "N:Class12;" & .Cells(i, 2).Value & ";;" & vbCr & _ "TEL;TYPE=HOME:" & .Cells(i, "F").Value & vbCr & _ "TEL;TYPE=WORK:" & .Cells(i, "G").Value & vbCr & _ "ADR;TYPE=HOME:;;" & .Cells(i, "I").Value & ";广州市;广东省;;中国" & vbCr & _ "ADR;TYPE=WORK:;;(" & .Cells(i, "C").Value & ")(" & .Cells(i, "D").Value & ")(" & _ .Cells(i, "E").Value & ");广州市;广东省;;中国" & vbCr & _ "End:VCARD" If FileText = "" Then FileText = FileText & ThisOne Else FileText = FileText & vbCr & ThisOne End If Next i End With NewTextFile FilePath, FileText End Sub Sub NewTextFile(ByVal FilePath As String, ByVal FileContent As String) Open FilePath For Output As #1 Print #1, FileContent Close #1 End Sub

  

20180821ImportContactFromExcel

标签:list()   card   close   ring   iphone   highlight   rac   文件   from   

原文地址:https://www.cnblogs.com/nextseven/p/9514490.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!