Skip i'r prif gynnwys

 Sut i allforio gwybodaeth cysylltiadau â lluniau yn Outlook?

Pan fyddwch yn allforio cysylltiadau o Outlook i ffeil, dim ond gwybodaeth destun y cysylltiadau y gellir ei hallforio. Ond, weithiau, mae angen i'r lluniau gael eu hallforio yn ogystal â gwybodaeth destun y cysylltiadau, sut allech chi ddelio â'r dasg hon yn Outlook?

Allforio gwybodaeth cysylltiadau â lluniau cymharol trwy ddefnyddio cod VBA


Allforio gwybodaeth cysylltiadau â lluniau cymharol trwy ddefnyddio cod VBA

Gall y cod VBA isod eich helpu chi i allforio pob cyswllt mewn ffolder cyswllt penodol i wahanu ffeil testun â lluniau. Gwnewch fel hyn:

1. Dewiswch ffolder cyswllt rydych chi am allforio'r cysylltiadau â lluniau.

2. Ac yna, dal i lawr y ALT + F11 allweddi i agor y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

3. Yna, cliciwch Mewnosod > Modiwlau, copïo a gludo islaw'r cod i'r modiwl gwag agored, gweler y screenshot:

Cod VBA: allforio gwybodaeth cysylltiadau â lluniau:

Sub BatchExportContactPhotosandInformation()
Dim xContactItems As Outlook.Items
Dim xItem As Object
Dim xContactItem As ContactItem
Dim xContactInfo As String
Dim xShell As Object
Dim xFSO As Scripting.FileSystemObject
Dim xTextFile As Scripting.TextStream
Dim xAttachments As Attachments
Dim xAttachment As Attachment
Dim xSavePath, xEmailAddress As String
Dim xFolder As Outlook.Folder
On Error Resume Next
Set xFSO = CreateObject("Scripting.FileSystemObject")
Set xShell = CreateObject("Shell.application").BrowseforFolder(0, "Select a Folder", 0, 16)
If xShell Is Nothing Then Exit Sub
xSavePath = xShell.Items.Item.Path & "\"
If Outlook.Application.ActiveExplorer.CurrentFolder.DefaultItemType <> olContactItem Then
    Set xFolder = Outlook.Application.Session.GetDefaultFolder(olFolderContacts)
Else
    Set xFolder = Outlook.Application.ActiveExplorer.CurrentFolder
End If
Set xContactItems = xFolder.Items
For i = xContactItems.Count To 1 Step -1
    Set xItem = xContactItems.Item(i)
    If xItem.Class = olContact Then
        Set xContactItem = xItem
        With xContactItem
            xEmailAddress = .Email1Address
            If Len(Trim(.Email2Address)) <> 0 Then
                xEmailAddress = xEmailAddress & ";" & .Email2Address
            End If
            If Len(Trim(.Email3Address)) <> 0 Then
                xEmailAddress = xEmailAddress & ";" & .Email3Address
            End If
            xContactInfo = "Name: " & .FullName & vbCrLf & "Email: " & _
                           xEmailAddress & vbCrLf & "Company: " & .CompanyName & _
                           vbCrLf & "Department: " & .Department & _
                           vbCrLf & "Job Title: " & .JobTitle & _
                           vbCrLf & "IM: " & .IMAddress & _
                           vbCrLf & "Business Phone: " & .BusinessTelephoneNumber & _
                           vbCrLf & "Home Phone: " & .HomeTelephoneNumber & _
                           vbCrLf & "BusinessFax Phone: " & .BusinessFaxNumber & _
                           vbCrLf & "Mobile Phone: " & .MobileTelephoneNumber & _
                           vbCrLf & "Business Address: " & .BusinessAddress
            Set xTextFile = xFSO.CreateTextFile(xSavePath & .FullName & ".txt", True)
            xTextFile.WriteLine xContactInfo
            If .Attachments.Count > 0 Then
                Set xAttachments = .Attachments
                For Each xAttachment In xAttachments
                    If InStr(LCase(xAttachment.FileName), "contactpicture.jpg") > 0 Then
                        xAttachment.SaveAsFile (xSavePath & .FullName & ".jpg")
                    End If
                Next
            End If
        End With
    End If
Next i
End Sub

doc allforio cysylltiadau â lluniau 1

4. Ar ôl pasio'r cod i'r modiwl, ewch ymlaen i glicio offer > Cyfeiriadau yn y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr, yn y popped allan Cyfeiriadau-Prosiect1 blwch deialog, gwirio Amser Rhedeg Sgriptio Microsoft opsiwn gan y Cyfeiriadau sydd ar Gael blwch rhestr, gweler y screenshot:

doc allforio cysylltiadau â lluniau 2

5. Cliciwch OK i gau'r ymgom, ac yna pwyso F5 allwedd i redeg y cod hwn, yn y popped allan Porwch Am Ffolder blwch deialog, nodwch ffolder lle rydych chi am allbynnu'r cysylltiadau a allforir, gweler y screenshot:

doc allforio cysylltiadau â lluniau 3

6. Yna cliciwch OK, mae'r holl wybodaeth gyda'r lluniau o'r cysylltiadau wedi'u hallforio i'ch ffolder benodol ar wahân, gweler y screenshot:

doc allforio cysylltiadau â lluniau 4


Offer Cynhyrchiant Swyddfa Gorau

Kutools ar gyfer Rhagolwg - Dros 100 o Nodweddion Pwerus i Werthu Eich Outlook

🤖 Cynorthwy-ydd Post AI: E-byst pro ar unwaith gyda hud AI - un clic i atebion athrylith, tôn berffaith, meistrolaeth amlieithog. Trawsnewid e-bostio yn ddiymdrech! ...

📧 E-bostio Automation: Allan o'r Swyddfa (Ar gael ar gyfer POP ac IMAP)  /  Amserlen Anfon E-byst  /  Auto CC/BCC gan Reolau Wrth Anfon E-bost  /  Awto Ymlaen (Rheolau Uwch)   /  Auto Ychwanegu Cyfarchiad   /  Rhannwch E-byst Aml-Dderbynnydd yn Negeseuon Unigol yn Awtomatig ...

📨 Rheoli E-bost: Dwyn i gof E-byst yn Hawdd  /  Rhwystro E-byst Sgam gan Bynciau ac Eraill  /  Dileu E-byst Dyblyg  /  Chwilio Manwl  /  Cydgrynhoi Ffolderi ...

📁 Ymlyniadau ProArbed Swp  /  Swp Datgysylltu  /  Cywasgu Swp  /  Auto Achub   /  Datgysylltiad Auto  /  Cywasgiad Auto ...

🌟 Rhyngwyneb Hud: 😊Mwy o Emojis Pretty a Cŵl   /  Rhowch hwb i'ch Cynhyrchiant Outlook gyda Golygfeydd Tabbed  /  Lleihau Outlook Yn lle Cau ...

???? Rhyfeddodau un clic: Ateb Pawb ag Ymlyniadau Dod i Mewn  /   E-byst Gwrth-Gwe-rwydo  /  🕘Dangos Parth Amser yr Anfonwr ...

👩🏼‍🤝‍👩🏻 Cysylltiadau a Chalendr: Swp Ychwanegu Cysylltiadau O E-byst Dethol  /  Rhannwch Grŵp Cyswllt i Grwpiau Unigol  /  Dileu Atgoffa Pen-blwydd ...

Dros Nodweddion 100 Aros Eich Archwiliad! Cliciwch Yma i Ddarganfod Mwy.

 

 

Comments (2)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Do you know that many (every ?) OpenSource alternative to Outlook are able to export contacts in vcard format, with all details and photos ?
Just with one click, no need to write any code...
Incredible, isn't it ?
This comment was minimized by the moderator on the site
It's because Oulook / Exchange are not free, you need to pay for everything ! :-)
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations