Digital-Inn
 
 

Go Back   Digital-Inn > Office-Welt > MS Outlook

MS Outlook Outlook . viel mehr als "nur" ein Mail-Programm.

Reply
 
Thread Tools Display Modes
Old 23-06-2008   #1
mb@btl
Registered User
Board-Frischling
 

Join Date: Jun 2008
Location: Düsseldorf
Posts: 1
Abgegebene Danke: 0
Erhielt 0 Danke für 0 Beiträge
Frage - Nachrichtenoptionen\Kontakte per VBA

Hallo zusammen,

da gibt es bei den Nachrichtenoptionen (rechte Maustaste auf der Mail) ein Feld "Kontakte". Dieses Feld möchte ich gerne via vba mit einem Wert füllen. Dieser Wert ist kein Kontakt, sondern ich nutze dieses Feld als Suchordner, denn dieses Feld kann ich mir in meiner Mailübersicht anzeigen lassen.


Dafür habe ich folgenden Code:

Dim ThisEmail as MailItem
Dim ID as string
Set ThisEmail = Outlook.Application.ActiveExplorer.Selection.Item(1)
Set ID = "TEST"
ThisEmail.Links.add(ID)
ThisEmail.Save


Beim Kompilieren kommt die Meldung (bei ThisEmail.links.add): Objekt erforderlich.

Was mache ich falsch?

Vielen Dank im Voraus!

Gruß
michi
mb@btl is offline   Reply With Quote
Sponsored Links
Old 08-07-2009   #2
nak
Registered User
 

Join Date: Jul 2009
Location: germany
Posts: 3
Abgegebene Danke: 0
Erhielt 0 Danke für 0 Beiträge
Hallo,
diese Meldung muss kommen. ...Links.Add erwartet tatsächlich ein Objekt. Meines wissens muss das Objekt vom Typ ContactItem sein. Ob andere Objekttypen funktionieren habe ich nie ausgetestet. Vielleicht helfen Dir aber trotzdem die nachfolgenden Zeilen.

Code:
Sub AddContatct()
  
  Dim objMail As Outlook.MailItem
  Dim objContact As Outlook.ContactItem
  Set objContact = Application.CreateItem(olContactItem)
  objContact.LastName = "fjldjfldfls"
  objContact.Save
  Set objMail = Application.ActiveExplorer.Selection.Item(1)
  objMail.Links.Add objContact
  objContact.Delete
  objMail.Save

End Sub

Gruß Karsten Natebus
nak is offline   Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +2. The time now is 13:57.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 2.4.0
Template-Modifikationen durch TMS
Advertisement System V2.5 By   Branden
Copyright by NightwoLF & Jesse69