Avatar billede niels_kristian Nybegynder
23. maj 2005 - 10:59 Der er 6 kommentarer og
1 løsning

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?
Avatar billede terry Ekspert
23. maj 2005 - 12:49 #1
Do you meen the Email Display As? If so then

oContact.Email1DisplayName = "Display Name"
Avatar billede niels_kristian Nybegynder
23. maj 2005 - 14:07 #2
den linje giver fejl..
Avatar billede terry Ekspert
23. maj 2005 - 14:27 #3
when you start entering

oContact.

You shoudl get a list of properties and methods, can you not see Email1displayName in the list?
Avatar billede niels_kristian Nybegynder
23. maj 2005 - 23:21 #4
jo det kan jeg godt.. men giver fejl..
Avatar billede terry Ekspert
24. maj 2005 - 09:14 #5
strange. Are you doing it before you set your variables to nothing?

which version of Outlook are you using?
Avatar billede niels_kristian Nybegynder
24. maj 2005 - 19:13 #6
ja før jeg sætter til nothing ..
bruger outlook 2003
Avatar billede terry Ekspert
25. maj 2005 - 20:17 #7
I have no problem altering oContact.Email1DisplayName

I'm doing it from Access (VBA) with Outlook 2003 and it works fine!

what error do you get?
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester