Outlook macro to set location
March 31, 2009 5:22 PM Subscribe
Outlook Macro Filter: I'm limping my way through creating VBA macro for use in OL07. Be my crutch.
This macro will be called from a button on the toolbar of an open, unsaved meeting invite, and would just append some static text (my conf bridge info) to the current contents of the Location field (there might be meeting room info in there already). This is basically what i've got:
meetingRequest.Location = "800-555-1234 / ID: 1234 / PW: 1234"
If that did work, it would replace, and not append. How do I append, and how do I affect a field on the current form?
Usually Google is my BFF for examples or guidance, but i'm only finding code samples for creating new invites on the fly, and saving them, which, to me is more work. What I am seeing is that all of the code samples I am finding have DIMs and SETs for creating new objects.
Is there a secret to having the macro act on a field in the active object? Do I need DIMs and SETs and whatnots? Can I append? Or am i just missing the whole concept of Macros and VBA?
IANACM, btw.
This macro will be called from a button on the toolbar of an open, unsaved meeting invite, and would just append some static text (my conf bridge info) to the current contents of the Location field (there might be meeting room info in there already). This is basically what i've got:
meetingRequest.Location = "800-555-1234 / ID: 1234 / PW: 1234"
If that did work, it would replace, and not append. How do I append, and how do I affect a field on the current form?
Usually Google is my BFF for examples or guidance, but i'm only finding code samples for creating new invites on the fly, and saving them, which, to me is more work. What I am seeing is that all of the code samples I am finding have DIMs and SETs for creating new objects.
Is there a secret to having the macro act on a field in the active object? Do I need DIMs and SETs and whatnots? Can I append? Or am i just missing the whole concept of Macros and VBA?
IANACM, btw.
Oh, and if you want a single line, try the following (all one one line):
posted by i love cheese at 8:39 PM on March 31, 2009
Application.ActiveInspector.CurrentItem.Location = Application.ActiveInspector.CurrentItem.Location & " 800-555-1234 / ID: 1234 / PW: 1234"
posted by i love cheese at 8:39 PM on March 31, 2009
Response by poster: Works great, as long as my cursor is not in the Location field. Thanks for the heads up on the ActiveInspector.
posted by tdischino at 11:30 AM on April 1, 2009
posted by tdischino at 11:30 AM on April 1, 2009
« Older Library school with an English MA: should I even... | Where do you "game" in the UK? Newer »
This thread is closed to new comments.
This tiny sub does not handle errors (e.g., no appointment or an email item is open instead of a calendar item).
posted by i love cheese at 6:33 PM on March 31, 2009