Results 1 to 3 of 3

Thread: Is it possible to insert Outlook Message in Microsoft Excel cell

  1. #1
    Join Date
    Oct 2011
    Posts
    81

    Is it possible to insert Outlook Message in Microsoft Excel cell

    I am attempting to inset and Outlook message into a cell in Excel. This is to enable me to keep a log of e-mails for particular topics and to store them within Excel so that I could double-click within the spreadsheet and bring up the e-mail. Have tried copying, pasting, importing, linking all to no avail. Any further ideas/help or perhaps a way to do in Access.

  2. #2
    Join Date
    May 2011
    Posts
    410

    Re: Is it possible to insert Outlook Message in Microsoft Excel cell

    I recently posted something like this in the dutch NG. It searched for a string in the subjects of the inbox (optionally filters to current month) then adds a hyperlink to the

    message. It uses a class module to trap the"search complete" event from outlook, which may be a bit over your head. Give it a try anyway. INSERT A CLASSMODULE
    note: CLASS module!! in properties window name it : COutlookSearch
    Code:
    Option Explicit
    
    Dim WithEvents olApp As Outlook.Application
    Const tagSS = "SubjectSearch"
    
    Sub SubjectSearch(sSubject$, Optional sScope$ = "Inbox", Optional
    bThisMonth As Boolean)
    Const csFILTER As String =
    "urn:schemas:mailheader:subject LIKE '%|s|%'"
    Dim sFilter$, hLink As Hyperlink
    
    For Each hLink In ActiveSheet.Hyperlinks
    If hLink.Range.Column = 1 Then
    hLink.Range.Clear
    hLink.Delete
    End If
    Next
    
    Set olApp = New Outlook.Application
    sFilter = Replace(csFILTER, "|s|", sSubject)
    If bThisMonth Then
    sFilter = sFilter & " AND
    %thismonth(urn:schemas:httpmail:datereceived)%"
    End If
    
    Call olApp.AdvancedSearch(sScope, sFilter, True, tagSS)
    End Sub
    
    Private Sub ProcessSubjectSearch(olSearch As Outlook.Search)
    Dim i%
    
    With olSearch.Results
    If .Count = 0 Then
    MsgBox "No items were found", vbExclamation, olSearch.Tag
    Else
    For i = 1 To .Count
    With .Item(i)
    ActiveSheet.Hyperlinks.Add _
    anchor:=ActiveSheet.Range("A1").Cells(i, 1), _
    Address:="outlook:" & .EntryID, _
    TextToDisplay:=.Subject
    End With
    Next
    End If
    End With
    Set olApp = Nothing
    
    End Sub
    
    Private Sub olApp_AdvancedSearchComplete(ByVal SearchObject As
    Outlook.Search)
    Select Case SearchObject.Tag
    Case tagSS
    Call ProcessSubjectSearch(SearchObject)
    Case Else
    MsgBox "Unknown search has completed. Tag:" & SearchObject.Tag
    End Select
    End Sub
    Once you are done with that you can insert a normal module name it: MEntry
    Code:
    Option Explicit
    Dim mclsOLS As COutlookSearch
    
    Sub CreateMailLinks()
    Set mclsOLS = New COutlookSearch
    mclsOLS.SubjectSearch "find this subject", , True
    End Sub

  3. #3
    Join Date
    Aug 2011
    Posts
    695

    Re: Is it possible to insert Outlook Message in Microsoft Excel cell

    I am working on a similar script like the one posted, so I ask my question in here. How is it possible to another mailbox in my Outlook, which is not in inbox access. It seems all my folders under as an independent mailbox folders such as Inbox, etc. with the standardized exactly that I want to access your Inbox.

Similar Threads

  1. Replies: 2
    Last Post: 27-01-2012, 07:59 PM
  2. Replies: 1
    Last Post: 24-01-2012, 02:03 PM
  3. Replies: 7
    Last Post: 12-09-2011, 10:48 PM
  4. insert picture in excel 2007 based on cell reference
    By joe.polkendare in forum Windows Software
    Replies: 5
    Last Post: 25-07-2011, 11:40 PM
  5. Way to insert a Date Picker in MS Excel cell
    By Chulbul Pandey in forum Windows Software
    Replies: 3
    Last Post: 11-12-2010, 12:55 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,561,182.76050 seconds with 17 queries