Transcription of Outlook VBA - riptutorial.com
1 Outlook -vba# Outlook -vbaTable of ContentsAbout1 Chapter 1: Getting started with Outlook -vba2 Remarks2 Examples2 Introduction2 Outlook Visual Basic for Applications3 Advanced topics3 Chapter 2: Introduction Part 1: Gaining access to Outlook 's Visual Basic Gaining access to Outlook 2003's Visual Basic Gaining access to the Visual Basic Editor in Outlook 2007 and Getting started with the Visual Basic What you should remember from this part of the tutorial13 Chapter 3: Introduction Part 2: Stores and top-level Expected prior Top level What you should remember from this tutorial17 Chapter 4: Introduction Part 3: Stores and all their folders18 Introduction18 Examples183.
2 0 Function GetFldrNames() which is needed for several of the demonstration Referencing a default Referencing any folder within any accessible Listing the names of every folder within every accessible Moving a folder from one parent folder to What you should remember from this part of the tutorial22 Credits24 AboutYou can share this PDF with anyone you feel could benefit from it, downloaded the latest version from: Outlook -vbaIt is an unofficial and free Outlook -vba ebook created for educational purposes. All the content is extracted from Stack Overflow Documentation, which is written by many hardworking individuals at Stack Overflow.
3 It is neither affiliated with Stack Overflow nor official content is released under Creative Commons BY-SA, and the list of contributors to each chapter are provided in the credits section at the end of this book. Images may be copyright of their respective owners unless otherwise specified. All trademarks and registered trademarks are the property of their respective company the content presented in this book at your own risk; it is not guaranteed to be correct nor accurate, please send your feedback and corrections to 1: Getting started with Outlook -vbaRemarksThis section provides an overview of what Outlook -vba is, and why a developer might want to use should also mention any large subjects within Outlook -vba, and link out to the related topics.
4 Since the Documentation for Outlook -vba is new, you may need to create initial versions of those related are currently three topics introducing Outlook VBA and at least three more are 1 describes how to get access to the Visual Basic you are a user of Outlook 2003 and a user of Excel VBA, you will learn little for this part since accessing the Outlook Visual Basic Editor is the same as accessing the Excel Visual Basic Outlook 2007 and later, the Developer tab. which gives access to the Visual Basic Editor, is not displayed for a new installation.
5 To display the Developer tab, you must perform an number of steps which are described in this part. There is no code in this 2 and 3 describe stores and folders which are where Outlook stores data. You could think of them as the equivalent of Excel's workbooks and worksheets. The division between part 2 and 3 is somewhat arbitrary. Part 2 describes stores and folders and includes macros to display the names of all accessible stores and the top level folders within those stores. Part 3 includes macro for accessing lower level folders. One pair of macros uses recursion which a new programmer may find difficult to understand.
6 The reader should aim to understand all the code in Part 2. It would however be legitimate to understand what that pair of macros does but not understand how they achieve their 4, the next part to be written, will introduce MailItems which hold emails. Part 3 includes a macro to move a folder from one parent to another but most macros operate on the objects contained within folders not folders themselves. Judging from the questions on Stack overflow, MailItems are of most interest to 5 will introduce CalendarItems which hold appointments. Part 6 will introduce the creation of new Excel workbooks from Outlook and the reading and updating of existing workbooks.
7 Part 7 will introduce Events unless some more immediately important topic is is important to understand this is an introduction to Outlook VBA not an introduction to VBA. Part 2 gives some guidance on where to get information on VBA but since the language is the same all Office products, a description of it belongs outside this introduction to Outlook Visual Basic for ApplicationsVisual Basic for Applications (VBA) is the macro language behind all Microsoft Office products and is essentially identical across all Office products. What differs from product to product is the Object model.
8 Excel has workbooks, worksheets and cells. Access has tables and attributes. Outlook has folders, emails and appointments. It is the Object Model that makes Excel VBA different from Outlook topicsThe various parts of the introduction aim to give the information that any programmer new to Outlook VBA would need. Much of the code was originally developed with Outlook 2003 and has been tested with Outlook 2016. It should work unchanged with any intermediate functionality has been introduced since Outlook 2003 which programmers will wish/need to access.
9 It is envisaged that "advanced topics" will be written to describe this Getting started with Outlook -vba online: 2: Introduction Part 1: Gaining access to Outlook 's Visual Basic EditorIntroductionGaining access to Outlook 's Visual Basic Editor, inserting your first module and renaming that prior knowledge: You are an Outlook Outlook 2003, you can immediately select the Visual Basic Editor. With later versions, you must add the Developer tab before you can select the Visual Basic Gaining access to Outlook 2003's Visual Basic EditorAll images are from UK versions of Outlook .
10 I know that some names are translated into the local language for other versions and I assume that most of the names for the tabs are translated. Probably the sequence of tabs is unchanged in non-English versions. Alternatively, you will need to look at your tabs and decide which would be equivalent of, for example, Tools With Outlook 2003 open, the top of the window might look like:Click Tools and move the cursor down to Macros to see:Move the cursor right then down and click Visual Basic Editor. Alternatively, exit the selections and click Alt+ Gaining access to the Visual Basic Editor in Outlook 2007 and images in this section are from the UK version of Outlook 2016.