outlook ændre jeg informationen display name eller på dansk vist
jeg bruger denne kode til at finde og ændre kontakt personer i outlook:Dim allcon(800) As String
Dim x As Integer
Dim oApp As Outlook.Application
Dim oNameSpace As Outlook.NameSpace
Dim oContacts As MAPIFolder
Dim oContact As Outlook.ContactItem
Dim bruger As String
bruger = SYSGetUserName()
Text1.Text = bruger
x = 0
On Error GoTo Proc_Err
Set oApp = CreateObject("Outlook.Application")
Set oNameSpace = oApp.GetNamespace("MAPI")
Set oContacts = oNameSpace.GetDefaultFolder(olFolderContacts)
For Each oContact In oContacts.Items
allcon(x) = oContact.FileAs ' .FullName
Debug.Print oContact.LastName
If bruger = oContact.NickName Then
test = InStr(1, allcon(x), ",", vbTextCompare)
If test > 0 Then
temp = Mid(allcon(x), 1, test - 1)
temp = temp & Mid(allcon(x), test + 1, Len(allcon(x)))
oContact.FileAs = temp ' .FullName = temp
oContact.Save
oContact.ManagerName = "TIS"
oContact.Save
Text2.Text = allcon(x)
Text4.Text = temp
Text3.Text = oContact.NickName
Debug.Print temp
End If
x = x + 1
End If
Next
Proc_Exit:
On Error Resume Next
Set oContact = Nothing
Set oContacts = Nothing
Set oNameSpace = Nothing
Set oApp = Nothing
Exit Sub
Proc_Err:
Resume Proc_Exit
Resume Next
End Sub
denne kode ændre oplysninger:
oContact.FileAs = temp ' .FullName = temp
oContact.Save
oContact.ManagerName = "TIS"
oContact.Save
men når jeg går ind og laver en ny mail så er der et display name eller på dansk vist navn i outlook hvordan ændre jeg dette?
