New Macro / VBA

  • Thread starter Thread starter DL
  • Start date Start date
D

DL

outlook 2007
I currently have macro / code saved in 'this outlook session'

I want to add a second, entirely separate code, I'm unsure if I 'insert' in
the above vba window, at the end, or should be doing something else.

My first macro, curtsy Sue M, is designed to open a window to save a sent
msg to a folder.
The second being a reminder if I forget to add an attachment to a msg

T/Y
 
If the new code is a macro -- that is, a Public subroutine with no
parameters -- you can write it in ThisOutlookSession or in a new code module
that you insert. You may want to use separate code modules to organize
macros that are for different purposes.

However, if your new code is not a macro but an event handler, put it in
ThisOutlookSession.
 
Thanks;
I took the code from here, http://www.danevans.co.uk/vba/
Opened the vba outlook window, which was allready populated with 'this
outlook session'
Inserted a new Module and pasted the code, compiled, saved and returned to
Outlook
Later shutdown OL, restarted and tested. Whilst 'send to' triggers the new
one doesnt
T/Y
PS I can happily get round vba in access, but in OL another story :(
 
That code is an event handler, not a macro, and therefore, should go in the
ThisOutlookSession module. If you already have an Application_ItemSend event
handler there, you'll need to combine the two procedures.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
OK, removed the module, added the code, after the code from your End
Function
Which when testing only triggered Send To folder & not trigger words, then
I'm guessing the code should be within the _ItemSend Sub?

(I was trying to work out how to step through the code, when testing, in
order to see where I was going wrong)
 
Yes, you should place any code that you want to process messages as they are
sent inside the Application_ItemSend event handler.

To step through the code, first use F9 to set a breakpoint. Then, when code
execution stops at that point, press F8 to execute each statement.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
OK, I'll have to work on that, maybe study some code samples, as I assume I
need to call that event to trigger the function, & I still cannot see quite
the way forward.
I'll get there just a little slow & its late
T/Y
 
Back
Top