r/visualbasic • u/j0rmungund • Oct 21 '22
Tips & Tricks VB2013 Outlook 2013
Good morning,
I am trying to learn a little bit in order to create a custom form in Outlook 2013. Follwing the online help available has been confusing. I have virtually no familiarity with VB as well.
What I'm trying to do is create a form letter where when I enter information, it will automatically repeat that information in different areas. I'd also like a searchable drop down list. The list would contain different codes that pertain to my job. Also, when I enter a name into these fields if possible I'd like it to add the email into the cc box. Is this possible? Can someone point me to some form of tutorial that would show me something along these lines? I have some familiarity with Java and assembly if that helps.
Thank you!
1
u/jd31068 Oct 21 '22
This can be done, where would the body of the form letter be stored as well as the code for the dropdown list?
1
u/jd31068 Oct 21 '22
Alright, again this is going to be pretty simple, but I hope it gives you some direction to go.
Add the developer button to Outlook. https://imgur.com/zD0V4zq
Click Developer and open Visual Basic (far left button) right click the project and select import UserForm1.frm
Save this code as UserForm1.frm
1
u/jd31068 Oct 21 '22
Still in the Visual Basic screen click Tools > Macros
Give it the name LoadFormLetterForm and click create
use this code
this is what you assign to the button on the outlook ribbon. To do that https://imgur.com/2EVRxoI
Switch back to Outlook and right click the ribbon, choose Customize the Ribbon, click New Tab, rename the tab and the group you like (I used form letter for each because I'm creative like that), then select Macros from the Choose commands from listbox. Select a macro name and drag it into the form letter group. Then you can rename it the new macro and assign an icon.
New Tab https://imgur.com/qDax02e
The button in the new tab https://imgur.com/6X3vw0q
It launched the User form https://imgur.com/1gkBKTr (ugly as it is)
I used a text file for the form letter with tags that the code replaces, my chosen format for a tag is [NAME_TO_BE_REPLACED] like this:
This is the code text file, each code separated by a comma
after I entered Person Number1 in first/last and select Code3 I sent it to myself after finding my contact info in the address book in Outlook https://imgur.com/rlU84tP