Cookies tgħinna jagħti servizzi tagħna. Bl-użu tas-servizzi tagħna, inti taqbel li l-użu tagħna ta 'cookies.
Tip: Lingwi oħra huma tradotti minn Google. Tista 'żżur il - English verżjoni ta 'din ir-rabta.
log in
x
or
x
x
reġistru
x

or

Kif tinħoloq appuntament minn dejta Excel?

Ejja ngħidu, għandek tabella ta 'dejta tal-ħatra f'fajl ta' l-Excel kif ġejja screenshot muri, issa, trid timporta din id-data fil-kalendarju ta 'l-Outlook. Kif tista 'tittratta dan ix-xogħol malajr?

L-esportazzjoni tad-dokumenti teċċellax id-dejta għall-ħatra 1

Oħloq appuntamenti minn dejta ta 'Excel b'kodiċi VBA


Oħloq appuntamenti minn dejta ta 'Excel b'kodiċi VBA

Biex toħloq ħatriet minn dejta ta 'Excel, tista' tapplika l-kodiċi VBA li ġej, jekk jogħġbok għamel hekk:

1. Tniedi Outlook u żomm il-buttuna ALT + F11 ċwievet biex tiftaħ il - Microsoft Visual Basic għall-Applikazzjonijiet tieqa.

2. Ikklikkja Daħħal > Moduli, u paste tal - kodiċi li ġej fil - Moduli Tieqa.

Kodiċi VBA: L-Import Excel Data għall-ħatra:

Public Sub CreateOutlookApptz()
    Dim xAppointmentItem As Outlook.AppointmentItem
    Dim xNameSpace As Outlook.NameSpace
    Dim xCalendarFld As Outlook.MAPIFolder, xSubFolder As Outlook.MAPIFolder
    Dim xCalendarStr As String
    Dim I As Long
    Dim xFileDialog As FileDialog
    Dim xFilePath As String
    Dim xExcelApp As Excel.Application
    Dim xWb As Workbook
    Dim xWs As Worksheet
    On Error GoTo Err_Execute
    Set xExcelApp = New Excel.Application
    Set xFileDialog = xExcelApp.FileDialog(msoFileDialogFilePicker)
    With xFileDialog
        .Title = "Select a file"
        .Filters.Add "Microsoft Excel", "*.xlsx"
    End With
    If xFileDialog.Show = 0 Then Exit Sub
    xFilePath = xFileDialog.SelectedItems(1)
    Set xWb = xExcelApp.Workbooks.Open(xFilePath)
    Set xNameSpace = Outlook.Application.Session
    Set xCalendarFld = xNameSpace.GetDefaultFolder(olFolderCalendar)
    I = 2
    Set xWs = xWb.Worksheets.Item(1)
    xCalendarStr = xWb.Name
    If FolderExist(xCalendarFld, xCalendarStr) = False Then
        Set xSubFolder = xCalendarFld.Folders.Add(xCalendarStr, olFolderCalendar)
    Else
        Set xSubFolder = xCalendarFld.Folders(xCalendarStr)
    End If
    Do Until Trim(xWs.Cells(I, 1).Value) = ""
        Set xAppointmentItem = xSubFolder.Items.Add(olAppointmentItem)
        With xAppointmentItem
            .Start = xWs.Cells(I, 5) + xWs.Cells(I, 6)
            .End = xWs.Cells(I, 7) + xWs.Cells(I, 8)
            .Subject = xWs.Cells(I, 1)
            .Location = xWs.Cells(I, 2)
            .Body = xWs.Cells(I, 3)
            .BusyStatus = olBusy
            .ReminderMinutesBeforeStart = xWs.Cells(I, 9)
            .ReminderSet = True
            .Categories = xWs.Cells(I, 4)
            .Save
        End With
        I = I + 1
    Loop
    Set xAppointmentItem = Nothing
    Set olApp = Nothing
    xExcelApp.Quit
    Set xExcelApp = Nothing
    MsgBox "Import successfully!", vbInformation, "Kutools for Outlook"
    Exit Sub
Err_Execute:
    MsgBox "An error occurred - Exporting items to Calendar.", vbInformation, "Kutools for Outlook"
End Sub
Function FolderExist(CalFolder As Folder, FolderName As String) As Boolean
    Dim I As Integer
    Dim xSubFolder As Folder
    For I = 1 To CalFolder.Folders.Count
        Set xSubFolder = CalFolder.Folders.Item(I)
        If xSubFolder.Name = FolderName Then
            FolderExist = True
            Exit Function
        End If
    Next I
End Function

3. Għadha fil - Microsoft Visual Basic għall-Applikazzjonijiet tieqa, ikklikkja għodod > Referenzi biex tmur fil - Referenzi-Proġett1 kaxxa ta 'dialog, u kontroll Microsoft Excel Object Library għażla mill - Referenzi Disponibbli kaxxa tal-lista, ara l-screenshot:

L-esportazzjoni tad-dokumenti teċċellax id-dejta għall-ħatra 2

4. Imbagħad ikklikkja OK buttuna, issa, agħfas F5 ċavetta biex imexxu dan il-kodiċi, u a Agħżel fajl tieqa hija murija, jekk jogħġbok agħżel il-fajl ta 'excel li trid timporta lejn Outlook, ara screenshot:

L-esportazzjoni tad-dokumenti teċċellax id-dejta għall-ħatra 3

5. U mbagħad ikklikkja OK, kaxxa fil-pront tinħareġ kif ġej:

L-esportazzjoni tad-dokumenti teċċellax id-dejta għall-ħatra 4

6. Imbagħad ikklikkja OK, id-data ta 'Excel ġiet importata fil-kalendarju kif ġej screenshot murija:

L-esportazzjoni tad-dokumenti teċċellax id-dejta għall-ħatra 5



Kutools għall-Outlook

Aktar minn Funzjonijiet Avvanzati ta '100 għal Outlook 2010, 2013, 2016, 2019 u 365

kutools ta 'screen shot għall-prospetti ċkejkna għall-bandiera 201812

Karatteristiċi Aktar | Free download | Biss $ 39.00 għal mijiet ta 'funzjonijiet

Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.