My presentation at SourceCon Atlanta Sept. 2018 featuring Excel VBA, Outlook VBA and JavaScript coding examples to introduce talent sourcers to programming
This PPT will tell you what and where marcros are needed and how to make them.
it will also talk about the little advanced macro to make your work simple
Getting Started in Custom Programming for Talent SourcingGlenn Gutmacher
If you think you're technical but never learned how to code, this should motivate you to realize you don't need to learn much in order to automate a lot of common talent sourcing activities
This PPT will tell you what and where marcros are needed and how to make them.
it will also talk about the little advanced macro to make your work simple
Getting Started in Custom Programming for Talent SourcingGlenn Gutmacher
If you think you're technical but never learned how to code, this should motivate you to realize you don't need to learn much in order to automate a lot of common talent sourcing activities
ASP.NET has evolved a lot in the last few years with the addition of ASP.NET MVC and Dynamic Data, as well as the continuous improvement of WebForms and ASP.NET AJAX. This session will provide a roadmap of the changes that are coming with ASP.NET 4 and Visual Studio 2010.
We continue checking Microsoft projects: analysis of PowerShellPVS-Studio
It has become a "good tradition" for Microsoft to make their products open-source: CoreFX, .Net Compiler Platform (Roslyn), Code Contracts, MSBuild, and other projects. For us, the developers of PVS-Studio analyzer, it's an opportunity to check well-known projects, tell people (including the project authors themselves) about the bugs we find, and additionally test our analyzer. Today we are going to talk about the errors found in another project by Microsoft, PowerShell.
Link your HTML Form to Google Sheet in just 3 Steps.pdfBe Problem Solver
One of the most frustrating things about HTML forms is that you have to do a lot of work before extracting any helpful information from them. But in this article, we show you how you can link an HTML form to Google Sheets.
Now, let’s jump straight to the coding part of the HTML form to Google Sheets:
This paper’s aim is to point out the RAD ( Rapid application development) elements present in the Microsoft’s MVC 3 and WCF 4.0 using Microsoft Visual Studio 2010. It will describe why creating a new web application using MVC 3 and WCF 4.0 is a easy and fast and also present simple ways to develop such applications.
Foundation and PathwaysCOS10020 Creating Web Application.docxhanneloremccaffery
Foundation and Pathways
COS10020 Creating Web Applications
Assignment 2
Semester 3, 2016
Purpose of Assignment:
An individual assignment, designed to familiarise in following the project life cycle in developing a website. It also provides an opportunity to practice again techniques and skills involved in designing webpages utilising validated HTML, and validated CSS using a standard text editor. Moreover, these webpages will contain input forms that will use Javascript to validate user data input before the form is submitted to the server for processing.
In this individual assignment you will develop a new Web form or enhance the Web form you developed in Assignment 1 by using PHP and storing server-side information in a MySQL database. This information will have been collected in your HTML Forms. It will involve the creation of simple MySQL tables to store, update and retrieve information from a Web site using MySQL commands.
Due Date: 8am Tuesday 10 January 2017
Submission as a single zip file, via the online submission system (Blackboard) http://blackboard.swin.edu.au/
Contribution to Final Assessment: 20%
Requirements and Specifications
The assignment requires you to develop a test website for a “Help Desk”. The director of the company is interested in developing a test website that allows the user to register a unique job number when first registering a technical problem. You are required to develop the front end (client) of the website. The director has asked a student, Mr Blog, who is taking up Web programming to develop the back end (server) of the website that will process the data input from the front end (client).
Task 1: Website Design
After several discussions with the director, it was agreed that 2 webpages will be developed. These are the Home Page and the Registration Page.
To keep the test website simple, the structure adopted is linear. Figure 2 illustrates the site map of the website.
The register.htm page:
1. Client side validation using Javascript.
The testreg.php page:
1. Redirects to the index page if registration is successful or outputs to successful registration feedback page with a link back to the index page.
2. Outputs an error page if server side validation fails. The outputted error page contains a link back to register.htm and index.html page.
Graphic Design
As part of the graphic design, it was agreed with the director that the main wireframe design for both webpages shown in Figure 3 be adopted.
These two structure elements will be styled by the CSS contained in common.css. You are free to design and add other structure elements to complete the index and the registration page.
Task 2: Construction and Content Development
Section One: HTML 5 Web Page
The two webpages must be developed using HTML5 to describe the content and structure. All pages must not contain any deprecated elements/attributes. The following HTML must be used in the assignment
· Index Page
· Anchor
· Registration pa ...
The Chromium browser is developing very fast. When we checked the solution for the first time in 2011, it included 473 projects. Now it includes 1169 projects. We were curious to know if Google developers had managed to keep the highest quality of their code with Chromium developing at such a fast rate. Well, they had.
Using prime[31] to connect your unity game to azure mobile servicesDavid Voyles
Using prime[31] to connect your unity game to azure mobile services. More info at my blog: http://davevoyles.azurewebsites.net/prime31-azure-plugin-win8-wp8-unity-games-part-3/
Similar to Gutmacher practical-coding-examples-for-sourcers-sc18 atl (20)
Competitive intelligence for sourcers gutmacher-TA Week 2021Glenn Gutmacher
presentation on competitive intelligence methods and tools for talent sourcers; big thanks to Greg Hawkes for contributions on an earlier version of this session co-presented at SOSU
Gutmacher In-House Sourcing Model Offshore and Onshore Nov. 2016Glenn Gutmacher
Avanade model - presentation for Human Resource Executive's TA Tech conference in Austin, TX (partnership with RecruitingTrends) in Nov. 2016 TalentTechConf.com
1. Practical Coding Examples for Sourcers:
Excel & Outlook VBA, JavaScript &
Bookmarklets, 100% Free
Glenn Gutmacher
VP Global Talent Sourcing Strategy Lead
State Street Corporation
www.linkedin.com/in/gutmach
First initial Last name at statestreet dot com
Yes, I’m getting
you involved:
take out your
notebooks and
fill out your
name and email
in this form so
you receive what
we’re outputting
today:
http://bit.ly/ggsc
123
2. Outlook Delayed Delivery is a good way to
avoid “oops- shouldn’t have sent that”
1. Under Outlook’s File tab, at bottom
of main pane, click “Manage Rules
& Alerts”
2. Click New Rule Apply rule on
messages I send, click Next at
bottom
3. Don’t select anything on Step 1-2
conditions, just click Next, then Yes
on “rule will be applied on every
message I sent” popup
4. On Step 1 (What do you want to do
with message?) action, select defer
delivery by, say, 2 minutes
3. 5. Don’t select anything on Step
1-2 exceptions, just click Next
6. Give the rule a name (e.g.,
Delay delivery), then click
Finish and OK buttons
7. Click Apply then OK button
8. Test by sending yourself an
e‐mail, which will stay in your
Outbox for the length of
delay you set. It will then
send and move to Sent Items
once the time has elapsed.
Outlook Delayed
Delivery (cont.)
4. Enhanced Outlook Delayed Delivery using VBA
• Now let’s enhance this to automatically email candidates
when they’re most likely to read your messages
(according to this, Thursday 6a-8a and evenings, then
weekends, but you can set any day/time rules in this)
• Follow one-time steps in Appendix to add Developer
menu to Outlook.
• Click Developer tab in top Outlook bar, then click Visual
Basic button at left under it.
• Under Microsoft Outlook Objects, double-click
ThisOutlookSession (see screenshot at right).
• Enter the code from http://bit.ly/ggsc2 (will redirect to
https://medium.com/@BMatB/delaying-email-sending-
outlook-vba-dbfd41a6ad01) and we’ll take you through
key parts of it.
5. 'Check if Before 7am
If SendHour < 7 Then
'MsgBox ("Before seven") comment this line out
SendHour = 8 - SendHour
SendDate = DateAdd("h", SendHour, SendDate)
SendDate = DateAdd("n", -MinNow, SendDate)
'Check if after 7PM other than Friday
If SendHour >= 19 Then 'After 7 PM
SendHour = 32 - SendHour 'Send a 8 am next day
'Check if Sunday
If WkDay = 1 Then
SendDate = Now()
SendDate = DateAdd("d", 1, SendDate)
'Check if Saturday
If WkDay = 7 Then
SendDate = Now()
SendHour = Hour(Now)
SendDate = DateAdd("d", 2, SendDate)
'Check if Friday after 7pm
If WkDay = 6 And SendHour >= 19 Then
'After 7pm Friday
SendDate = Now()
SendHour = Hour(Now)
SendDate = DateAdd("d", 3, SendDate)
SendDate = DateAdd("h", 8 - SendHour,
SendDate)
Enhanced Outlook Delayed Delivery using VBA (cont.)
6. Via Mike Hudson (example: send on next
weekday at 7:30am):
If Weekday(Date, vbMonday) = 6 Then
'Check if today is Sat. (weekday value=6)
nxtMonday = Date + (2)
'so Mon. = today + 2 days
Mail.DeferredDeliveryTime =
nxtMonday & " 07:30:00" 'Set
delivery in 2 days at 7:30am
Other ways to deal with dates and times:
Via Diane Poremsky: (example: if after
6PM, send next day at 7AM):
If Now() > DateSerial(Year(Now),
Month(Now), Day(Now)) + #5:59:00 PM#
Then
SendAt = DateSerial(Year(Now),
Month(Now), Day(Now) + 1) + #7:00:00
AM#
Enhanced Outlook Delayed Delivery using VBA (cont.)
7. Bonus option:
utilize the Importance
property to bypass
delay if email marked
High Importance / red
exclamation point
(explained here):
If Mail.Importance =
olImportanceHigh
Then …
Enhanced Outlook Delayed Delivery using VBA (cont.)
Other useful tips you can utilize in other macros:
1. Begin each line of code with a unique alphanumeric immediately
followed by a colon. This allows your macro to indicate the exact
line where any errors occur, as well as jump to different parts of
your code when desired (e.g., On Error Goto YourAlphanum).
2. You can automate the insertion of these numbers using any of
these methods.
3. This version includes useful guidelines about where row numbers
can and cannot be used.
4. See it in context here (another version of delayed delivery macro)
ErrHand: 'If any error, alert with detailed description in a popup box
MsgBox ("An error occurred on line " & Erl & ", with a description: "
& Err.Description & ", and an error number " & Err.Number)
8. Excel VBA
code
example
Business need: You
want to send an email
mail merge campaign
BUT you want some
messages to come
from different
senders. MS Office’s
default mailmerge
functionality won’t
allow this, but this
macro will!
9. Excel VBA code example (cont.)
First you need to have the Excel developer tab in your Excel ribbon, explained on slides 22-24.
We’ll be working off this code example by Diane Poremsky (shortcut: http://bit.ly/ggsc3) – copy it
and Insert in a new module. Only modifications I made (copy from http://bit.ly/ggsc225) were to:
1. Insert a MsgBox popup to ensure user has everything ready before macro runs:
If MsgBox("Before running this macro, make sure you have:" & vbNewLine & _
"1) enabled Microsoft Outlook Object Library (if unsure, in Excel's top horizontal menu, click " & _
"Developer, then click Visual Basic (left-most button under that), then in the Tools menu, select References. " & _
"You may add as many checkboxes as you like, but make sure Microsoft Outlook Object Library is one of them." &
vbNewLine & _
"2) the Outlook template (.oft) you want to use for the mail merge matches the .oft name/path in the macro." &
vbNewLine & _
"3) the Excel worksheet to pull merge data from OPEN AS THE ACTIVE worksheet." & vbNewLine & _
"Click OK if all above is true, else click Cancel. Then re-run macro by selecting View --> Macros --> View Macros" & _
" --> select 'SendMailMergeExcel' macro --> Run.", vbOKCancel) = vbCancel Then Exit Sub
10. Excel VBA code example (cont.)
2. substitute more practical body merge
fields: expertise and metro location:
Dim strSubject As String, expertise As String,
metroArea As String, senderEmail As String
expertise = xlSheet.Range("F" & rCount)
metroArea = xlSheet.Range("G" & rCount)
senderEmail = xlSheet.Range("H" & rCount)
.Body = Replace(.Body, "[First Name]", strFirstname)
.Body = Replace(.Body, "[Expertise]", expertise)
.Body = Replace(.Body, "[MetroArea]", metroArea)
3. Other minor changes:
Set xlSheet = xlWB.ActiveSheet
‘active sheet rather than force it to be “Sheet1”
'if adding attachments:
'.Attachments.Add strAttachment
.Save 'save the message with the above changes
.Display 'To start, keep this line as is to display the
email on screen before sending, to verify it’s OK
'.Send 'To start, comment this line so it will not send
automatically - you can manually hit Send button on
each test message when ready
'Once you know macro is working correctly, comment
the .Display line and un-comment the .Send line &
everything will send automatically.
11. An Excel VBA example (cont.)
What your source file should look like (fine if you only have a few rows like this to start,
since you’ll want to test to make sure it looks correct before sending)...
Note that the CC column can be blank for some or all recipients, and you could add or
substitute a BCC column if you’d rather have a record for yourself (or bcc: your colleague)
12. Webscraping example in JavaScript (thanks, Andre Bradshaw!)
Code highlights (with extra comments):
var list = document.getElementsByClassName("large-11 columns program");
// mousing over each school in Elements tab of browser inspector, we see
above div class highlights a school's whole set of data
// initial guess is:
var schoolname = list[i].getElementsByClassName("detailslink-
title")[0].innerText;
// testing this in Console -- console.log(schoolname) -- we get the list of
schools and cities!
// similarly this gets degree program and years:
var degreeProg = list[i].getElementsByTagName("p")[1].innerText;
// type clear() in console to erase output thus far & get you back to top
Here’s the data I wanted to
grab: http://accredit-
id.org/accredited-programs
(shortcut: http://bit.ly/ggsc4)
Why it’s challenging for the
commercial scrapers to
process is that some of the
data I want is *not* contained
between specific HTML tags,
or within a class or ID value.
Git repo to download:
http://bit.ly/ggsc22 (redirects
to Andre B’s repo here)
13. Webscraping example in JavaScript (continued)
var schoolname = list[i].getElementsByTagName("p")[0].innerText.replace(/,/g, '_');
// within each <p> tag and replace all commas with underscores to avoid csv delimiter issues later
var degreeProg = list[i].getElementsByTagName("p")[1].innerText.replace(/,/g, '_');
var website = list[i].getElementsByTagName("a")[0].href;
// console.log(website) confirms above gets each URL
var programDeetz = list[i].getElementsByClassName("program-details")[0];
// the class program-details contains what we want
var person =
validate(/.+?(?=nPhone)|.+?(?=nnPhone)/.exec(programDeetz.innerText),0).replace(/,/g, ";");
// regex positive lookahead for all chars on line preceding 1 or 2 line returns then Phone
var phone = /(?<=Phone:s*).+/.exec(programDeetz.innerText)[0];
// within that, do regex for phone numbers, i.e., lookbehind
// grab all .+ that follows Phone: and any spaces, within innerText of 1st element of programDeetz
14. Webscraping example in JavaScript (continued)
// positive lookbehind, negative lookbehind, positive lookahead, and negative lookahead are all
explained well at www.regular-expressions.info/lookaround.html
var email = /(?<=mailto:).+?(?)/.exec(programDeetz.innerHTML)[0]; // similarly, grab all text
following mailto:
var arr = new Array(schoolname,degreeProg,website,person,phone,email); // array to contain
each component
containArr.push(arr+'r'); } // and insert line return after each school
var output = 'school_name,degree_program,website,person,phone,emailr'+containArr.toString();
// above to create a header row of values, line return, followed by the data, then convert all to a string
// below function to create and append an invisible download link for file, click it, then remove it
15. Webscraping example in JavaScript (continued)
function dl(filename, text) {
var elmi = document.createElement('a');
elmi.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
elmi.setAttribute('download', filename); elmi.style.display = 'none';
document.body.appendChild(elmi); elmi.click();
document.body.removeChild(elmi);
}
var namethis = /(?<=org/).+?(?=/)/.exec(window.location.href);
// generate a name (to be used later for the csv file) of whatever the url is following org/
// (since this particular website is a .org) with a positive lookahead of any char .+ string
// until the next forward slash, escaped as (?=/) and the lookahead is not part of the match by
definition, so it's just grabbing the next part of path as filename
dl(namethis+".csv", output)
16. Webscraping example in JavaScript (continued)
// invoke function using partialpath.csv as 1st filename argument, and data (output var as 2nd text
argument
// .csv file will have downloaded, can open or launch a new google sheet and drag file from downloads
bar into
// sheet & it prompts to import file (replace spreadsheet, separator type auto-detect, click import data
button)
Version without comments you can download (courtesy of Andre Bradshaw):
https://github.com/andrebradshaw/Random-DOM-
scraping/blob/master/bookmarklet_download_CIDA_as_csv.js
Turn it into a bookmarklet at https://mrcoles.com/bookmarklet/ and drag it into your browser!
Speaking of bookmarklets, if we have time, let’s look at several others useful to sourcers here!
18. Super-Useful References
Excel VBA
• Ron DeBruin has many great how-to’s
• Well-explained examples (with video) of
web scraping using VBA (though Python-
or JS-based tools are more flexible)
Outlook VBA
• How to setup Outlook to run VBA code
(add clickable macro icons in menus, etc.)
• Great overall tutorial (by Microsoft)
• Some nice variations on the Delay
Delivery macro: this, this and this (google:
outlook vba delay delivery for more)
• Diane Poremsky has many great how-to’s
JavaScript, RegEx & Bookmarklets
• MrColes convert JS to bookmarklet tool
• Regular Expressions reference & tutorials
• JavaScript intro course on Codecademy,
WatchAndCode’s Practical JavaScript course
(among many free options – search for it!)
Google Apps Script (& more JavaScript)
• Google’s own tutorials
• Andre Bradshaw is a great sourcing coder in
JavaScript and Google Apps Script. Download
his Github repos and his companion video
tutorials.
19. Setting up for Outlook VBA
One-time steps so you can run (or edit) any VBA
macros in Outlook from your computer:
• In MS Outlook’s File menu, select Options
(bottom left). In left column menu, select Trust
Center. Click gray Trust Center Settings button.
Under Macro Settings, select the “Enable all
macros” radio button and select the “Trust access
to the VBA project model” checkbox (ditto for
“Apply macro security settings to installed add-
ins”, if visible). Click OK to close.
• If the Developer tab doesn’t appear in your
Outlook top main horizontal menu, right click
anywhere in that menu and select Customize the
Ribbon and select the Developer checkbox (see
steps 1-3 of the screenshots here covering this
one-time setup).
• When you launch Outlook, you may see a
popup that macros have been disabled
and a button to Enable Macros. You need
to click the button to run macro(s),
assuming you know yours are safe.
• This page explains it all well! (shortcut:
http://bit.ly/ggsc24 )
20. Setting up for Excel VBA
One-time steps so you can run (or edit) any VBA macros
for Excel from your computer:
• In MS Excel’s File menu, select Options (bottom left).
In left column menu, select Trust Center. Click gray
Trust Center Settings button. Under Macro Settings,
select the “Enable all macros” radio button and select
the “Trust access to the VBA project model”
checkbox (ditto for “Apply macro security settings to
installed add-ins”, if visible). Click OK to close.
• If the Developer tab doesn’t appear in your Excel top
main horizontal menu, right click anywhere in that
menu and select Customize the Ribbon and select the
Developer checkbox (see steps 1-3 of the screenshots
here covering this one-time setup).
• You also need some common references pre-loaded
in Excel: Click Developer tab (you just added in the
previous step), then click Visual Basic (leftmost
button under that). In the Tools menu, select
References. The first several checkboxes should be
selected (if they aren’t already), and particularly add
the checkboxes for “Microsoft VBScript Regular
Expressions 5.5” and “Microsoft Visual Basic for
Applications Extensibility” (and if you do web scraping
in VBA, the web-browser interaction ones as described
here). Unfortunately, you need to make sure other
users of this macro also have done these three steps,
but at least it’s a one-time procedure that only takes a
minute (see the top-voted answer here to learn more).
• When you actually open an Excel file containing a
macro (typically filetype .xlsm) you may see a ribbon
just under the top ribbon with a yellow Security
Warning that macros have been disabled and a
button to Enable Macros. You need to click the
button to run the macro(s), assuming you know it’s a
safe macro.
21. Setting up for Excel VBA (continued)
• For macros you will use yourself and probably not share,
leverage the existing Personal.xlsb file on your computer
(read this to learn how to open or create it, if it doesn’t
already open automatically when you launch Excel. The
resulting file will reside at
C:UsersyourusernameAppDataRoamingMicrosoftEx
celXLSTART
• Or for a macro you’ll likely share, create and save a new
Excel macro-enabled file. If you choose this option, in
the File –> Save As dialog, make sure to change the Save
As Type menu value from the default “Excel Workbook”
to “Excel Macro-Enabled Workbook”. This will result in a
file ending in .xlsm as opposed to .xlsx default.
• Whichever option you choose, now:
1) open your VBE (Visual Basic Editor) by clicking the
Developer tab in the upper horizontal Microsoft Excel
menu, then click the “Visual Basic” button below and to
the left (some keyboards allow the Alt+F11 shortcut to
access this).
• 2) Right-click on your workbook file name in the
“Project-VBAProject” pane (at top left of the editor
window) and select Insert –> Module from the menu
(not Class Module)
3) Copy-Paste all the macro below code into the
large empty right-hand pane, and note the name of
the macro (what follows Sub near the start of the
macro code).
4) Close the VBA editor by clicking the X at upper
right (macro code is automatically saved upon
close).
5) To run the macro, in Excel’s upper horizontal
menu, select View, then Macros, then View Macros,
click/highlight the name of the macro you want to
run, then click Run button.
For a nice step-by-step of the above with annotated
screenshots, see this, or if you prefer videos, see this
(actually, the whole Excel VBA video series by Alex
Cantu is well done).
22. Setting up for Excel VBA
One-time steps that address the most common
initial frustrations so you can run (or edit) code by
anyone in VBA from your computer:
1. In Microsoft Excel’s File menu, select Options
(at bottom left).
2. In left column menu, select Trust Center.
3. Click gray “Trust Center Settings” button
(bottom right).
4. Under Macro Settings, select the “Disable all
macros with notification” radio button and
select the “Trust access to the VBA project
model” checkbox. Click OK button at bottom to
close.
TIP: When you open any Excel file containing a
macro (typically filetype .xlsm), it may show a
yellow Security Warning that macros have been
disabled. You must click the “Enable Macros”
button to run any macro(s), assuming you know
they’re safe.
23. Setting up(cont.)
If not, Customize the Ribbon and select
the Developer checkbox as indicated
below (& steps 1-3 of the screenshots at
http://www.excel-easy.com/vba/create-a-
macro.html) covering this one-time setup.
Is Developer mode in your Excel main menu? (You need it.)
24. Setting up for Excel VBA(cont.)
You’ll want to pre-load some common reference libraries:
• Click Developer tab (generated on previous slide), then
click Visual Basic (leftmost button under that).
• In the Tools menu, select References. Particularly select the
checkboxes for “Microsoft VBScript Regular Expressions
5.5”, “Microsoft Office Object Library” and “Microsoft
Visual Basic for Applications Extensibility”. (These may be
further down the list, in alphabetical order.)
• Unfortunately, you need to make sure other users of your
macro also selected these (if needed by your macro), but
at least you see it’s a quick, one-time procedure (see the
top-voted answer here to learn more).
• See Appendix for additional setup steps you *might* need.
25. Excel VBA bonus example
Business need: You want to send an email campaign to
people across a particular Outlook folder of emails where
messages meet certain criteria. This macro:
1. lets you select any Outlook (sub)folder in your mailbox
or shared box (personal or corp. Outlook Exchange);
2. For the messages you want, automatically grabs all the
email addresses in the body of those messages
(including the senders);
3. plops them into an Excel file;
4. de-duplicates and sorts the results; and
5. inserts references after each email address with
subject line, sent date and message sender, to make it
convenient to trace the source for context/reference.
Let’s look through highlights in the code…
26. Excel VBA bonus (cont.)
• The usual first set of statements are to dimension (set the type of) your variables. Some types are
unique to MS Outlook (more here). String, Long, Object, Range and Boolean are more universal.
Dim objItems As Outlook.Items, objFolder As Outlook.MAPIFolder, olItem As Outlook.MailItem
'Dim is the command preceding var As type; above ones are Outlook-specific, below are some more common ones:
Dim xlApp As Object, xlWB As Object, xlSheet As Object, ws As Worksheet
Dim fNameAndPath As Variant, deduperList(), foundEmails() 'Variant is default when you don't specify a type
'but a var name immediately followed by () implies it will be an array
Dim sText As String, OneRange As Range, SortCell As Range 'Range refers to a span of one or more cells; String is for
text
Dim a As Long, i As Long, messageCount As Long, LastRow As Long 'Integer works for smaller numbers,
'but Long works regardless how large your var gets & runs faster than Integer, so always use Long!
Dim bXStarted As Boolean 'True or False
Dim Regex As Object, olMatches As Object, Match As Object, M As Object 'used to find pattern matches to regular
expressions
27. Excel VBA bonus (cont.)
This section determines what subset of emails in the folder we want to process...
i = 1 'initialize loop counter for use below
For Each olItem In objItems 'For loop to review each email in the folder
On Error Resume Next 'if an error, it will move to next item/loop
If (olItem.Subject Like "*SRSC*" Or olItem.Subject Like "*SourceU*") And InStr(olItem.Subject, _
"Delivery Status Notification") < 1 And InStr(olItem.Subject, "Undeliverable") < 1 Then
'above looks for subject lines containing SRC or SourceU *and* do not contain Delivery Status
Notification or Undeliverable
sText = olItem.Body 'Outlook item body, is a built-in element
‘similarly, could additionally filter based on words in the message body using the same type of If statement
If we don’t have time to review further, you can still figure out the rest by reviewing comments in the code
Editor's Notes
Title Page: Font is Lato; SourceCon Green color is: Hex: #68ae44 | RGB: R(104) G(174) B(68)
Remember, you can use full screen pictures! People love Pictures! ** Right Click -> format Background -> Insert Picture From -> File .. Pick your file!