I would like to put this inputbox value....
Into the below so that the value that the user input replaces the "GLAM" in the Set FLDR line.
Code:
inboxfldr = InputBox("Enter Outlook Folder Name", "Inbox Alert Folder")
Into the below so that the value that the user input replaces the "GLAM" in the Set FLDR line.
Code:
Sub GetFromInbox()
Dim olApp As Outlook.Application
Dim olNs As Namespace
Dim Fldr As MAPIFolder
Dim olMail As Variant
Dim DateCount As Integer
Dim myDate1 As Date
Dim myDate2 As Date
Dim item As Object
Dim doClip As MSForms.DataObject
Dim xlApp As Object ' Excel.Application
Dim xlWkb As Object
Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.GetDefaultFolder(olFolderInbox).Folders("[U]GLAM[/U]")
Set doClip = New MSForms.DataObject
x = Date
myDate1 = Sheets("Inbox Alerts").Range("A1").Value
myDate2 = Sheets("Inbox Alerts").Range("B1").Value
For Each olMail In Fldr.Items
If DateSerial(Year(olMail.ReceivedTime), Month(olMail.ReceivedTime), Day(olMail.ReceivedTime)) >= myDate1 And _
DateSerial(Year(olMail.ReceivedTime), Month(olMail.ReceivedTime), Day(olMail.ReceivedTime)) <= myDate2 And _
InStr(olMail.Subject, "Alert") >= 0 _
Then
doClip.SetText olMail.Body
doClip.PutInClipboard
Sheets("Inbox Alerts").Cells(Rows.count, 1).End(xlUp).Offset(1, 0).PasteSpecial "Text"
DateCount = DateCount + 1
End If
Next olMail
Set Fldr = Nothing
Set olNs = Nothing
Set olApp = Nothing
End Sub