I apologize for the duplicate posting since I am new to this forum and was under the impression that each forum was different.
I apologize for the duplicate posting since I am new to this forum and was under the impression that each forum was different.
Welcome to VBAX rolling_zep. You are right in some ways, all the forums are indeed slightly different and at first somewhat mystifying to the new people. But hey, you have to start somewhere. So here's a couple of things we very much prefer.
Any question relating to the Office suite. Whilst we are predominately VBA orientated we still try to answer object questions as well; and
We prefer workbooks with examples whenever possible when posting questions; and
Code scripts rather than images; and
When the issue is posted elsewhere, that a link is provided, so we can see what help if any has already been provided; and
A little understanding that at times maybe even our members may not be able to assist.
From what I have seen so far you will be a wonderful addition to our membership. Reach out if you have any queries and we'll see what we can do to assist.
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
Thank you and if you can see my VBA question in my original post, I need a solution.
I since modified my entire code but the count is zero, meaning it is not reading the mailbox and attachments.
Private Sub cmdOutlook_Click() Dim OlItems As Outlook.Items Dim olItem As Outlook.MailItem Dim olFolder As Outlook.MAPIFolder Dim X, y As Long Dim strFileName As String Dim strFile As String Set olFolder = Outlook.GetNamespace("MAPI").Folders("WeeklyProceedings Mailbox").Folders("Inbox") 'providing the object of the mails in the inbox Set OlItems = olFolder.Items For Each olItem In OlItems X = olItem.Attachments.Count If X > 0 Then For y = 1 To X 'getting the attachment name strFileName = olItem.Attachments.item(y).FileName 'saving the attachment in a temporary location olItem.Attachments.item(y).SaveAsFile "C:\Users\prasad.govindarajan\Testing\" & olItem.Attachments.item(y).FileName Next y End If olItem.Save Next
This is my mail setup. I need to read the mails in the Inbox in WeeklyProceedings Mailbox.
I suspect this line of code
Set olFolder = Outlook.GetNamespace("MAPI").Folders("WeeklyProceedings Mailbox").Folders("Inbox"). Probably it is not the correct way
MailBox.jpg
Last edited by rolling_zep; 08-11-2023 at 01:07 PM.