Kopier Selected Mail Adresse...
Denne kode åbner den mail man har makeret i Outlook og åbner den i en msgbox. Det jeg har brug for er en kode der åbner Mail Adressen Og Emnet på den mail som er makeret i Outlook... Det har dog forvoldt mig nogle problemer så jeg vil se om nogle af jer kan klare dette!!!Husk at Add Outlook i \"References\" i VB
------------------------------
Private Sub Command1_Click()
Dim oApp As Outlook.Application
Dim oExp As Outlook.Explorer
Dim oSel As Outlook.Selection \' You need a selection object for getting the selection.
Dim oItem As Object \' You don\'t know the type yet.
Dim i As Long
On Error GoTo ErrorHandler
Set oApp = New Outlook.Application
Set oExp = oApp.ActiveExplorer \' Get the ActiveExplorer.
Set oSel = oExp.Selection \' Get the selection.
If oSel.Count = 0 Then
MsgBox \"Nothing selected\"
Exit Sub
End If
For i = 1 To oSel.Count \' Loop through all the currently .selected items
Set oItem = oSel.Item(i) \' Get a selected item.
DisplayInfo oItem \' Display information about it.
Next i
Exit Sub
ErrorHandler:
MsgBox (\"Nothing selected\")
End Sub
Sub DisplayInfo(oItem As Object)
\'You need the message class to determine the type.
strMessageClass = oItem.MessageClass
If (strMessageClass = \"IPM.Note\") Then \'Mail Entry.
Set oMailItem = oItem
MsgBox oMailItem.Subject
MsgBox oMailItem.Body
End If
End Sub
