Results 1 to 2 of 2

Coding for multi "*.vcf" file to outlook contact

Threaded View

  1. #1
    Registered User
    Join Date
    11-01-2012
    Location
    A, A
    MS-Off Ver
    Excel 2007
    Posts
    2

    Post Coding for multi "*.vcf" file to outlook contact

    Cara Impot file Vcf ke Outlook

    1. Membuat folder di kasih nama misal "NomorKontak"
    2. Copy semua file vCard (**.vcf) ke dalam folder itu.
    3. Buka ALT + F11 untuk buka VBA editor.
    klik TOOLS --> REFERENCES pilih "Microsoft Scripting Runtime" dan "Windows Script Host Object Model".
    klik INSERT --> MODULE dan copy paste coding dibaah ini.

    Sub SimpanVcf() 
    Dim objWSHShell As IWshRuntimeLibrary.IWshShell 
    Dim Aplikasi As Outlook.Application 
    Dim InspOutlk As Outlook.Inspectors 
    Dim AlmatFileVcf As String 
    Dim fso As Scripting.FileSystemObject 
    Dim fsDir As Scripting.Folder 
    Dim NamaFile As Scripting.File 
    Dim HitungVc As Integer 
    Set fso = New Scripting.FileSystemObject 
    Set fsDir = fso.GetFolder("C:\VCARDS")
    
    For Each NamaFile In fsDir.Files
    
        AlmatFileVcf = "C:\VCARDS\" & NamaFile.Name 
        Set Aplikasi = CreateObject("Outlook.Application") 
        Set InspOutlk = Aplikasi.Inspectors 
            If InspOutlk.Count = 0 Then 
            Set objWSHShell = CreateObject("WScript.Shell") 
            objWSHShell.Run Chr(34) & AlmatFileVcf & Chr(34) 
            Set InspOutlk = Aplikasi.Inspectors 
        If Err = 0 Then 
                Do Until InspOutlk.Count = 1 
                    DoEvents 
                Loop 
                InspOutlk.Item(1).CurrentItem.Save 
                InspOutlk.Item(1).Close olDiscard
                Set InspOutlk = Nothing 
                Set Aplikasi = Nothing 
                Set objWSHShell = Nothing 
            End If 
        End If
    
    Next
    
    End Sub
    Last edited by arlu1201; 11-06-2012 at 02:44 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1