Hallo zusammen,
ich verwende folgendes Skript, um einen link auf eine Outlook-Mail zu generieren, welchen ich in einem externen Programm verwenden kann, um auf diese Mail zu referenzieren. Das funktioniert soweit sehr gut, nun würde ich das Skript gerne so anpassen, dass im Link auch noch das Absende-Datum mit angegeben wird. Die vermutlich relevante Code-Passage habe ich gelb markiert.
Könnt Ihr mir helfen, um welchen Code-Schnipsel ich diese Zeile erweitern muss, damit auch noch das Datum angegeben wird?
vielen Dank!
Function SetClipBoardText(ByVal Text As Variant) As Boolean
SetClipBoardText = CreateObject("htmlfile").ParentWindow.ClipboardData.SetData("Text", Text)
End Function
'Adds a link to the currently selected message to the clipboard
Sub ObsidianLink()
Dim objMail As Object
Dim txtObsLink As String
Dim exito As Boolean
Dim doClipboard As New DataObject
'One and ONLY one message muse be selected
If Application.ActiveExplorer.Selection.Count <> 1 Then
MsgBox ("Select one and ONLY one message.")
Exit Sub
End If
Set objMail = Application.ActiveExplorer.Selection.Item(1)
If objMail.Class = olMail Then
txtObsLink = "[MESSAGE: " + objMail.Subject + " (" + objMail.SenderName + ")](outlook:" + objMail.EntryID + ")"
ElseIf objMail.Class = olAppointment Then
txtObsLink = "[MEETING: " + objMail.Subject + " (" + objMail.Organizer + ")](outlook:" + objMail.EntryID + ")"
ElseIf objMail.Class = olTask Then
txtObsLink = "[TASK: " + objMail.Subject + " (" + objMail.Owner + ")](outlook:" + objMail.EntryID + ")"
ElseIf objMail.Class = olContact Then
txtObsLink = "[CONTACT: " + objMail.Subject + " (" + objMail.FullName + ")](outlook:" + objMail.EntryID + ")"
ElseIf objMail.Class = olJournal Then
txtObsLink = "[JOURNAL: " + objMail.Subject + " (" + objMail.Type + ")](outlook:" + objMail.EntryID + ")"
ElseIf objMail.Class = olNote Then
txtObsLink = "[NOTE: " + objMail.Subject + " (" + " " + ")](outlook:" + objMail.EntryID + ")"
Else
txtObsLink = "[ITEM: " + objMail.Subject + " (" + objMail.MessageClass + ")](outlook:" + objMail.EntryID + ")"
End If
doClipboard.SetText txtObsLink
doClipboard.PutInClipboard
exito = SetClipBoardText(txtObsLink)
End Sub
|