+ Reply to Thread
Results 1 to 2 of 2

How to add a keyword in outlook in searchbar from excel vba

Hybrid View

newguy007 How to add a keyword in... 12-21-2016, 12:10 AM
chetnagoyal.01 Re: How to add a keyword in... 04-08-2017, 02:36 PM
  1. #1
    Registered User
    Join Date
    12-12-2016
    Location
    Mumbai,India
    MS-Off Ver
    11
    Posts
    6

    How to add a keyword in outlook in searchbar from excel vba

    I want to place the entered keyword from excel in to search bar in outlook. I referred to this doc and tried this.

        Dim OutApp As Object, wK As Worksheet, kWd As String
        Set wK = Sheet1
    
        kWd = Trim(wK.Range("D4").Value)
    
        kWd = "urn:schemas:mailheader:subject = " & kWd
    
        Set OutApp = CreateObject("Outlook.Application")
        'Searches the Inbox folder
    
        Dim objSch As Outlook.Search
        Const strS As String = "Inbox"
        Const strTag As String = "SubjectSearch"
        Set objSch = _
           OutApp.AdvancedSearch(Scope:=strS, Filter:=kWd, Tag:=strTag)
    I am getting Run-time error 446: object doesn't support named arguments error on the last line.

    I am not sure if this is the correct way to do this.


    search.jpg

  2. #2
    Registered User
    Join Date
    03-23-2017
    Location
    India
    MS-Off Ver
    Office 2013
    Posts
    1

    Re: How to add a keyword in outlook in searchbar from excel vba

    Did anyone got the working code for the same. I also have same question

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Search cells C1:C3000 for keyword and if exists place a keyword in A1:A3000
    By GregQuick in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-24-2015, 07:38 PM
  2. Outlook 2010 - Search / Replace with Link (start at keyword)
    By M McKenney in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 04-04-2014, 03:54 PM
  3. Replies: 6
    Last Post: 03-18-2014, 11:16 AM
  4. Filter List by Keyword & copy the result in column by keyword as header
    By kitunga in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-21-2013, 07:16 AM
  5. macro to copy mulitiple sheets to Outlook email (keyword being multiple)
    By garzajd3 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-22-2012, 05:33 AM
  6. Replies: 2
    Last Post: 07-13-2012, 04:02 AM
  7. Replies: 0
    Last Post: 02-09-2012, 12:30 PM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1