I want to open a folder that is in a personal folder (instead of \\outlook\inbox it is \\personal folder\pacc) but cannot seem to be able to point. My main goal is to open that folder up and save each mailitem in that folder as a .txt file with the subject and the date being the file name. Do I still use Set fldFolder = nmsName.GetDefaultFolder(olFolderInbox) to access the folder?
My code is starting to look something like:
Dim myItem As Inspector
Dim objItem As Object
Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myFolder = myNamespace.GetDefaultFolder(olFolderInbox)
Set myItem = myOlApp.ActiveInspector
If Not TypeName(myItem) = "Nothing" Then
Set objItem = myItem.CurrentItem
strname = objItem.Subject
objItem.SaveAs "C:\" & strname & ".txt", olTXT
MsgBox "There is no current active Inspector."
Set myNewItem = myFolder.Items(1)
Of course this uses ActiveInspector but I want it to automatically go into the folder and perform the saveas without any mailitems opened.
Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code.