Skip to main content


Showing posts from March, 2016

Outlook VBA get address book names

How to get Outlook address book names via VBA?
Outlook has the option to create multiple address books. Of course, it's for a good reason, to organize address books.
Well, why need to organize? I guess the reason will depend on every individual whether it's a thing to practice or a thing to be ignored.
Outlook address book can be set to manage contacts.
For example, you can have an address book just for Personal use which includes friends and family.
You can set the address book for vendors and another address book for customers only and of course contacts within the organization.
Organizing is a skill if not an attitude to make work easier and manageable.
VBA code below will get all the address book names on Outlook, and once the address book is known you can expand the code to get contacts for each specific address book by supplying the address book name.
====================================== Sub getfoldercontact_addressbook_names()

Dim mContact As AddressList
Dim mAddressBook…

PowerShell send csv content via email

A simple PowerShell code snippet to send contents of a csv file to an email.
It can be used to send a reminder with the contents type on the csv file. 

The code below can also be used to send reminders to customer or promotion emails which only need text files.
Or got logs on a server or applications, but the code below will need to be modified to follow the format of the logs.
The code below requires PS 5.0.
Tweak the code to suit CSV format; format used below is for demo purposes.
From what I observed PowerShell reads the code from the last column with contents to the first column of the excel sheet.
The code below uses this CSV format.
Highlighted text below is column headers in the CSV file, which is defined as an array on PowerShell script.
ToxSubjectxBodyxuser1_tech@myemail.comPC ReminderTurn off PC @ 5PMuser2_tech@myemail.comServer ReminderReboot Server @ 12:30am
From above contents of CSV, PowerShell is able to send out multiple emails and contents base on the data on the CSV.

If  the…