none
Visual Basic for Applications in MS Outlook RRS feed

  • Question

  • Hi Guys,

    I am new to ms vba.. and requesting could you all please help with following requirement...

    read an inbox or any selected folder within inbox of ms outlook and read the emails and create with following data.. where attachment name and size are dynamic columns as per count... also there will be form for user to select start and end dates and upon clicking submit it should enable to save the excel file as per below generated to save in desired location.

    Date     From_Address     Subject      Attachment_Count      Attachment_Name.Extension         Attachment_Size  

    cheers !!


    • Moved by Perry-Pan Tuesday, May 15, 2018 6:06 AM
    Monday, May 14, 2018 1:38 PM

Answers

  • Hi,

    Thank you for visiting Office Forum.

    Then here we mainly focus on  general questions and feedback related to Office 2010 desktop application. Since your issue is more related to VBA, I'll help move this thread to Outlook for developers forum.

     

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.

      

    Thank you for your understanding.

    Regards,

    Perry


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.


    • Edited by Perry-Pan Tuesday, May 15, 2018 6:05 AM
    • Marked as answer by Sachinbuzz Wednesday, May 16, 2018 3:17 AM
    Tuesday, May 15, 2018 6:05 AM
  • Hello Sachinbuzz,

    It seems that you want to export attachments information of selected mail to an Excel workbook, right? Your code need many steps but not complex. I'm wondering which part bothers your.

    You could try to get the selected mail via Application.ActiveExplorer.Selection(1). If you have selected multiple mails, you need loop Application.ActiveExplorer.Selection one by one.

    Once you get the MailItem of the select mail, you could got its SenderEmailAddress(From_Address), Subject and Attachments collection. Based on the Attachments collection, you could got Attachments.Count and loop through the collection, you could got the Attachment.Filename and Attachment.Size.

    Once you got these information you want, you could try to create an excel workbook to store them and then save the workbook.

    Please try to refer to the process and tell us which part bothers you.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Sachinbuzz Wednesday, May 16, 2018 3:17 AM
    Tuesday, May 15, 2018 8:14 AM
  • Hello Sachin,

    Nobody will do your job for you. We can help with specific questions.

    > I am new to ms vba

    I'd recommend starting from the Getting Started with VBA in Outlook 2010 article. This article is for experienced Outlook users who want to learn about VBA and who want some insight into how programming can help them to tailor Outlook to meet their needs. Before you read this article you might want to read the introductory article, Getting Started with VBA in Office 2010, which goes into more detail about the fundamentals of VBA programming.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    • Marked as answer by Sachinbuzz Wednesday, May 16, 2018 3:17 AM
    Tuesday, May 15, 2018 9:53 AM

All replies

  • Hi,

    Thank you for visiting Office Forum.

    Then here we mainly focus on  general questions and feedback related to Office 2010 desktop application. Since your issue is more related to VBA, I'll help move this thread to Outlook for developers forum.

     

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.

      

    Thank you for your understanding.

    Regards,

    Perry


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.


    • Edited by Perry-Pan Tuesday, May 15, 2018 6:05 AM
    • Marked as answer by Sachinbuzz Wednesday, May 16, 2018 3:17 AM
    Tuesday, May 15, 2018 6:05 AM
  • Hello Sachinbuzz,

    It seems that you want to export attachments information of selected mail to an Excel workbook, right? Your code need many steps but not complex. I'm wondering which part bothers your.

    You could try to get the selected mail via Application.ActiveExplorer.Selection(1). If you have selected multiple mails, you need loop Application.ActiveExplorer.Selection one by one.

    Once you get the MailItem of the select mail, you could got its SenderEmailAddress(From_Address), Subject and Attachments collection. Based on the Attachments collection, you could got Attachments.Count and loop through the collection, you could got the Attachment.Filename and Attachment.Size.

    Once you got these information you want, you could try to create an excel workbook to store them and then save the workbook.

    Please try to refer to the process and tell us which part bothers you.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Sachinbuzz Wednesday, May 16, 2018 3:17 AM
    Tuesday, May 15, 2018 8:14 AM
  • Hello Sachin,

    Nobody will do your job for you. We can help with specific questions.

    > I am new to ms vba

    I'd recommend starting from the Getting Started with VBA in Outlook 2010 article. This article is for experienced Outlook users who want to learn about VBA and who want some insight into how programming can help them to tailor Outlook to meet their needs. Before you read this article you might want to read the introductory article, Getting Started with VBA in Office 2010, which goes into more detail about the fundamentals of VBA programming.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    • Marked as answer by Sachinbuzz Wednesday, May 16, 2018 3:17 AM
    Tuesday, May 15, 2018 9:53 AM
  • Thanks !! Perry
    Tuesday, May 15, 2018 1:32 PM
  • Thanks Terry..

    my design would start from a form with start and end date.. and clicking on submit button it should create a excel file and save it to desired location.

    Tuesday, May 15, 2018 1:34 PM
  • Thanks Eugene.. greatly appreciate.. i am quite new to this form and technology so was unable to search any organised tutorial hence had to post this.. the links you have shared will act as a catalyst for me.. appreciate it.
    Tuesday, May 15, 2018 1:36 PM