I've done some searching, and I can't quite find a definitive yes or no answer anywhere.
I'm writing a program that will, when you press a button in Excel, go to outlook, scan it for particular e-mails, then download the attachments in a certain way. Ok, very doable, lots of guides out there how to do it.
What I can't find is if it's doable on a variable folder structure. As in, everyone who's going to use this program has their outlook folders set up in a different way. Is there a way to be able to find the emails I want wherever they're hiding, without creating a unique path per person who might use this program, and without making every person who might use this email set up their inbox in the same way?
The email name will be the same every day, with a date appended, which is how I plan to find the email in the first place.
If the folders you're looking for all have something in common, you might be able to use a For Each loop and a conditional:
For each folder in myFolder.Folders
If folder.Name = "Surprise Party" then
'Run code
End If
Next folder
Looping through a dynamic number of folders to find a specific item is not the best option performance wise. A better approach is to use the AdvancedSearch method. You can specify multiple folders and include subfolders and then iterate through a single collection (.Results).
Related
I have a word document with a building block dropdrown to choose from several templates. I have the Word document set with a tool bar with the Send To Recipient email option. I'm trying to figure a way to get the subject line to change depending on what building block is chosen, if it's even possible.
Currently, my office is using different word files for each subject line, and I'm trying to get all templates in one file to cut down on all the different files workers need to have open at once.
Is this possible?
I have limited vb experience, but I have tried searching for macros and code that was similar to what I needed, and changing things to fit, but I'm at a loss. Anything I try outside of that just results in the subject like being static, remaining as the last edit.
I currently have a macro which prompts for person initials. After initials are provided, the macro prompts for addressee information. Once that information is provided in different prompts, the macro pulls a specific template for the initials entered at the beginning and populates merge fields with the data entered in the other prompts. The final result is a letter. The template already contains the senders information, address, phone numbers, etc. This is the current, working solution.
The problem is, there are hundreds of letter templates, one for each person. When something global changes like email domain, all the templates need to be updated and it takes forever to do it.
I would like to keep the senders information in a single repository (.csv, .txt, whatever works best) [call it "DB"] and a single letter template. Then, I want to modify the macro to still prompt for initials, but then instead of opening that person's letter template, I want it to open the "single" template and populate the sender's information from the "DB." The macro would still prompt for the addressee information because of course, this changes all the time. I'm looking to improve the way the sender's templates are being maintained. So, if something global changes, only one document needs to be revised and may be easier to do with Find/Replace than opening hundreds of docs for editing.
Since there are so many possible solutions, I'm asking for your opinion on what would be the best way to do it. I'm thinking about storing in csv file, but then, how do I find a particular sender in the csv? By searching for their initials? and how would that look like in Word VBA?
Is it possible to delete Search Folders in Outlook using VBA?
I'm trying to figure out, but I don't know how to do it.
My goal is to make a search folder as a temporary storage of my mails and delete it after accessing the emails inside the search folder. I already have the code for creating search folder. But what I want to do is delete the search folder.
I found a code in slipstick.com but my knowledge is not enough to understand the whole process of the program:
http://www.slipstick.com/developer/create-an-outlook-search-folder-using-vba/
Use the Delete method of the Folder class.
Is there any easy way to quickly search for the name of a folder in Outlook's inbox folder structure?
I am talking about this:
I have to categorize emails into this folder structure as they arrive but 99% of the time is looking for the right folder...
We are running our own Exchange and I am using Outlook over rdp
http://i.stack.imgur.com/wZDKS.png
The Outlook object model doesn't provide any property of method for that.
You need to develop a VBA macro or add-in to ge the job done. For example, you can iterate over the folders structure to find the required one. The Folders property of the Folder class returns the Folders collection that represents all the folders contained in the specified Folder. So, you may walk down to the tree recursively.
I write a lot of proposals in MS Word and we use a template that we go in and change out specific values, i.e. Client Name (used multiple times throughout document), URL, Price, Page count, etc... Sometimes these variables get overlooked or missed. I wanted to know is there a way to just type the Client name once and have it update throughout the page. Also is it possible to edit these values in a separate document and link the proposal template to generate a modified proposal each time?
I'd like to know if all this is possible within just Word and not using VB scripts or anything like that.
Mail merge?
Or maybe a template/form would be better for you.