outlook-vba

How do I get the Outlook VBA "FreeBusy" method to return the truth?

I've got a simple bit of Outlook VBA which looks up the FreeBusy status of a number of meeting rooms to determine whether or not they are free. In the last couple of days, the following code: sResult = olRecipient.FreeBusy(olCurrentItem.Start, 15, True) causes incomplete FreeBusy information to be returned, often all zero's. If I th...

Why does SaveAs Method throw error?

I have the following vba code is part of a larger script. The issue I am having is that that the SaveAs function continuously throws an error even though the Outlook message has been saved to a directory on the system. Inspection of the the Err object yields no results as everything is either blank or 0. Another weird issue is that whe...

Can I iterate through all Outlook emails in a folder including sub-folders?

I have a folder which contains a number of emails and sub-folders. Within those sub-folders are more emails. I'd like to write some VBA which will iterate through all emails in a certain folder, including those in any of the sub-folders. The idea is to extract the SenderEmailAddress and SenderName from every email and do something with ...

Gmail like "Send and Archive" in Outlook. How to get to the "parent" email when replying.

Responding to an email with the subject line "test", with this code... Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) If TypeName(Item) = "MailItem" Then Debug.Print Item.Subject Debug.Print Item.Parent End If End Sub ...returns this. Inbox RE: test I'm looking to get to "test", which is ...

Adding an Outlook 'tooltip' to mail message read area

I'd like to have the ability to highlight a number and look it up in an external browser based system. Is it possible to add a right-click action to Outlook and open a url using the highlighted text? ...

Auto accept outlook VBA

Is there a VB macro or some sort of add-on out there that will allow me to auto accept invitations in outlook by sender or by folder? I was thinking about doing a VB script for this but I don't want to re-invent the wheel? ...

Outlook VBA to BCC emails sent not working in Outlook 2007

Inserted code in ItemSend and saved the ThisOutlookSession module. It worked once and no longer works. Before anyone asks; it was saved as BVaproject.OTM and is still there when I open the module back up after restarting Outlook. Private Sub Application_ItemSend(ByVal Item As Object, _ Cancel As Bool...

How can I make Outlook 2007 auto BCC messages to a specific email with specific words in subject using VBA?

So far I have this code from outlookcode.com which I can get to work sending all emails I send to the BCC email. I am not a developer, so I don't have a lot of context to go about editing this myself, or even approaching researching this. If anyone knows how to make this check for words in the subject, or check if the subject equals a ce...

Ensuring the contacts in a Distribution List are displayed with both name and email address

How can I ensure the contacts I add to an Outlook distribution list are displayed with both name and email address? These contacts may not exist in any other address book, just the distribution list. Currently they show up just as an email address (in both columns). Here's roughly the VBA we're using: Do Until RS.EOF //h...

How to remove a specific category on a selected mail in Outlook 2003 with Macro?

Hi, I am trying to transform my Outlook2003 into the closest thing to gmail. I started to use categories, which are pretty similar to labels in gmail. I can assign categories automatically with rules, and I can add categories manually. I have also created "search folders", that show all mails with a given category, if they are not in...

UserForm in script run from Outlook Rule

Based on http://support.microsoft.com/kb/306108 I'd like to create a custom rule that shows a custom UserForm instead of the plain old MsgBox. What I wrote was this: Dim alerts As CustomAlerts Sub CustomMailMessageRule(Item As Outlook.MailItem) alerts.Messages.AddItem Item.Subject alerts.Show End Sub CustomAlerts is a UserForm...

Transponse the data from vertical to horizondal using vba

I wants to popualte the data in MS-Access into Excel for this i am using VBA This is my code varConnection = "ODBC; DSN=MS Access Database;DBQ=D:\sample\table.accdb; Driver={Driver do Microsoft Access (*.accdb)}" varSQL = "SELECT * FROM LeftPanes" With ActiveSheet.QueryTables.Add(Connection:=varConnection, Destination:=Act...

Perform CRUD for todos/tasks/appointments from Outlook?

How can I perform CRUD (Create, Read, Update, Delete) for todos/tasks/appointments/etc from Outlook. Does Microsoft have a data api like Google that I can use to interact with Microsoft applications? I prefer this in C++ (Microsoft Visual C++), but Java will also work. ...

Applicaion.AdvancedSearch not filtering when run on a Mounted mailbox contacts folder

We are using OL 2003 and are building an addin in which we use Application.AdvancedSearch. We use this API to get filtered contact lists. Works just fine on most machines. On some however, the search result brings back all contacts seemingly ignoring the filter. Its certainly not a code issue - it works fine on most machines. Advanced ...

Opening Word (from Outlook VBA) in Safe Mode

I have a Word document as an attachment to an email that I need to get some data out of to pass to a URL. To do this I'm saving the attachment to the local temp file, then opening the document, and then using the Word object model to pull data out of tables in the document. I'm having a couple of problems when opening the document in V...

Hotkey for moving messages from inbox to archive in Outlook

I'd like to configure a hotkey, in MS Outlook, which does the following to the highlighted/selected messages: Mark as read (by default it's [crtl]+Q) Move to an "archive" folder (archive meaning a folder other than the default inbox) This should happen whenever I press [crtl]+M (assuming it is not already reserved), on any amount of ...

while itemadd event works in my outlook it doesn't work in friends pc outllok

as part of making a tool i have written a code which is perfectly working in my sytem but not in my friends pc both of use the same outlook version here is snippet Private WithEvents olInboxItems As Items ...... .... // some code here Private Sub start_Click() Dim objNS As nameSpace Set objNS = Application.Session ' inst...

Outlook VBA 6.5 not running script when message arrives

Hi, I have created a procedure in VBA 6.5 for Outlook - all new messages should be treated by this procedure but they are not. I create rule by going to RUles and Alerts in Tools option. Then do not choose anything to treat for all incoming emails, then I click run a script -> choose the script. This is script: Sub Mytest(Item As...

how to open a mail item selector dialog in vba outlook

is there any function to open a mail item selector using a dialog. like we have for opening a file in windows. i tried searching outllook help but was unable to find please help ...

I want to save a file from a website embedded in a email using VBA in Outlook 2007

What I am trying to do is create a VBA macro that is triggered when a rule is invoked from a specific email that has a standard format in the subject header. When this rule is invoked it will scrap the email for a website address. The problem I have is I want to save a file to a specific location. The file accessed is not a file that c...