New Macro / VBA

  • Thread starter Thread starter DL
  • Start date Start date
Status
Not open for further replies.
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.

Sue Mosher

"DL" <notvalid@spoofaddress.co.uk> wrote in message

news:e4xn2kTFKHA.5916@TK2MSFTNGP03.phx.gbl...
> 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
>
 
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 :(

"Sue Mosher [MVP]" <suemvp@turtleflock.com> wrote in message

news:ufenS0TFKHA.4316@TK2MSFTNGP04.phx.gbl...
> 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.

> > Sue Mosher
> > >

> "DL" <notvalid@spoofaddress.co.uk> wrote in message
> news:e4xn2kTFKHA.5916@TK2MSFTNGP03.phx.gbl...
> > 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
> >


>
 
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

"DL" <notvalid@spoofaddress.co.uk> wrote in message

news:uJZzN1ZFKHA.4316@TK2MSFTNGP04.phx.gbl...
> 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 :(

> "Sue Mosher [MVP]" <suemvp@turtleflock.com> wrote in message
> news:ufenS0TFKHA.4316@TK2MSFTNGP04.phx.gbl...
> > 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.



>

>> "DL" <notvalid@spoofaddress.co.uk> wrote in message
> > news:e4xn2kTFKHA.5916@TK2MSFTNGP03.phx.gbl...
> >> 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
> >>

>

>>


>
 
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)

"Sue Mosher [MVP]" <suemvp@turtleflock.com> wrote in message

news:ONQkW3cFKHA.3396@TK2MSFTNGP04.phx.gbl...
> 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
> > >

> "DL" <notvalid@spoofaddress.co.uk> wrote in message
> news:uJZzN1ZFKHA.4316@TK2MSFTNGP04.phx.gbl...
> > 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 :(
>

>> "Sue Mosher [MVP]" <suemvp@turtleflock.com> wrote in message
> > news:ufenS0TFKHA.4316@TK2MSFTNGP04.phx.gbl...
> >> 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.

>
> >
>>> "DL" <notvalid@spoofaddress.co.uk> wrote in message
> >> news:e4xn2kTFKHA.5916@TK2MSFTNGP03.phx.gbl...
> >>> 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
> >>
>>
>>>

>

>>


>
 
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

"DL" <notvalid@spoofaddress.co.uk> wrote in message

news:eT4mdcfFKHA.1376@TK2MSFTNGP02.phx.gbl...
> 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)

> "Sue Mosher [MVP]" <suemvp@turtleflock.com> wrote in message
> news:ONQkW3cFKHA.3396@TK2MSFTNGP04.phx.gbl...
> > 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.

>
> > "DL" <notvalid@spoofaddress.co.uk> wrote in message
> > news:uJZzN1ZFKHA.4316@TK2MSFTNGP04.phx.gbl...
> >> 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 :(
> >
>>> "Sue Mosher [MVP]" <suemvp@turtleflock.com> wrote in message
> >> news:ufenS0TFKHA.4316@TK2MSFTNGP04.phx.gbl...
> >>> 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.

> >
> >>
>>>> "DL" <notvalid@spoofaddress.co.uk> wrote in message
> >>> news:e4xn2kTFKHA.5916@TK2MSFTNGP03.phx.gbl...
> >>>> 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
 
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

"Sue Mosher [MVP]" <suemvp@turtleflock.com> wrote in message

news:%23%23Nc$YgFKHA.4432@TK2MSFTNGP05.phx.gbl...
> 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
> > >

> "DL" <notvalid@spoofaddress.co.uk> wrote in message
> news:eT4mdcfFKHA.1376@TK2MSFTNGP02.phx.gbl...
> > 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)
>

>> "Sue Mosher [MVP]" <suemvp@turtleflock.com> wrote in message
> > news:ONQkW3cFKHA.3396@TK2MSFTNGP04.phx.gbl...
> >> 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.

> >
> >> "DL" <notvalid@spoofaddress.co.uk> wrote in message
> >> news:uJZzN1ZFKHA.4316@TK2MSFTNGP04.phx.gbl...
> >>> 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 :(
> >>
>>>> "Sue Mosher [MVP]" <suemvp@turtleflock.com> wrote in message
> >>> news:ufenS0TFKHA.4316@TK2MSFTNGP04.phx.gbl...
> >>>> 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.
> >
>>>>
>>>>> "DL" <notvalid@spoofaddress.co.uk> wrote in message
> >>>> news:e4xn2kTFKHA.5916@TK2MSFTNGP03.phx.gbl...
> >>>>> 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


>
 
No, you don't "need to call that event." The event handler's code runs

automatically whenever a user sends an item.

Sue Mosher

"DL" <notvalid@spoofaddress.co.uk> wrote in message

news:uCXZV8hFKHA.4316@TK2MSFTNGP02.phx.gbl...
> 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

> "Sue Mosher [MVP]" <suemvp@turtleflock.com> wrote in message
> news:%23%23Nc$YgFKHA.4432@TK2MSFTNGP05.phx.gbl...
> > 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.
>

>> "DL" <notvalid@spoofaddress.co.uk> wrote in message
> > news:eT4mdcfFKHA.1376@TK2MSFTNGP02.phx.gbl...
> >> 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)
> >
>>> "Sue Mosher [MVP]" <suemvp@turtleflock.com> wrote in message
> >> news:ONQkW3cFKHA.3396@TK2MSFTNGP04.phx.gbl...
> >>> 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.
> >
>>>> "DL" <notvalid@spoofaddress.co.uk> wrote in message
> >>> news:uJZzN1ZFKHA.4316@TK2MSFTNGP04.phx.gbl...
> >>>> 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 :(
> >>>
>>>>> "Sue Mosher [MVP]" <suemvp@turtleflock.com> wrote in message
> >>>> news:ufenS0TFKHA.4316@TK2MSFTNGP04.phx.gbl...
> >>>>> 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.
> >>
>>>>>
>>>>>> "DL" <notvalid@spoofaddress.co.uk> wrote in message
> >>>>> news:e4xn2kTFKHA.5916@TK2MSFTNGP03.phx.gbl...
> >>>>>> 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

>

>>


>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
D VBA Macro to Print and Save email to network location Outlook VBA and Custom Forms 1
N VBA Macro To Save Emails Outlook VBA and Custom Forms 1
N Help creating a VBA macro with conditional formatting to change the font color of all external emails to red Outlook VBA and Custom Forms 5
L Modifying VBA script to delay running macro Outlook VBA and Custom Forms 3
L Macro/VBA to Reply All, with the original attachments Outlook VBA and Custom Forms 2
A VBA macro for 15 second loop in send and received just for 1 specific mailbox Outlook VBA and Custom Forms 1
G VBA Macro Using Outlook 4
R Help Revising VBA macro to delete email over different time span Outlook VBA and Custom Forms 0
L Moving emails with similar subject and find the timings between the emails using outlook VBA macro Outlook VBA and Custom Forms 1
N How can I increase/faster outlook VBA Macro Speed ? Using Outlook 2
D.Moore Folder view settings by VBA macro Outlook VBA and Custom Forms 57
J Help Please!!! Outlook 2016 - VBA Macro for replying with attachment in meeting invite Outlook VBA and Custom Forms 9
R VBA macro - new message Outlook VBA and Custom Forms 3
S Example VBA Macro - To Conditionally Change the From Account and Add a BCC Address on Emails Outlook VBA and Custom Forms 11
S VBA Macro - Run-time error '424': object required - Help Please Outlook VBA and Custom Forms 3
B VBA Macro for assigning multiple Categories to an email in my Inbox Outlook VBA and Custom Forms 1
M Slow VBA macro in Outlook Outlook VBA and Custom Forms 5
M VBA macro for Inbox's attachments search Outlook VBA and Custom Forms 0
Y VBA Macro to highlight some Keyword in mail body? Outlook VBA and Custom Forms 3
J Macro only runs within VBA Editor Outlook VBA and Custom Forms 2
D VBA macro printing attachments in shared mailbox Outlook VBA and Custom Forms 1
G VBA/Macro to remove page colour when replying or forwarding email Outlook VBA and Custom Forms 2
S Outlook 7 VBA macro for multiple filing Outlook VBA and Custom Forms 1
M Outlook VBA Macro that could retrieve/display the (From, Subject, Date Received) Outlook VBA and Custom Forms 2
Philip Rose Recreating a WORD Editing Macro to use in Outlook VBA Outlook VBA and Custom Forms 4
T Random problem in VBA macro Outlook VBA and Custom Forms 6
M recover deleted items vba macro Outlook VBA and Custom Forms 2
P Vba script including macro appears in rules but wont run Outlook VBA and Custom Forms 6
S VBA Macro to VBScript Outlook VBA and Custom Forms 1
L VBA Macro to flag sent emails Using Outlook 1
B Outlook vba macro Using Outlook 1
B Auto BCC VBA macro: how to add exceptions? Using Outlook 28
R VBA Macro to VBScript in a form- Help Please! Using Outlook 10
D VBA Macro Works in 2007 but errors in 2010 Using Outlook 2
E Word macro running from OL VBA throwing error on Word SaveAs?? Outlook VBA and Custom Forms 8
J Outlook custom form - VBS call VBA macro Outlook VBA and Custom Forms 3
N VBA Procedure (or Macro) to Stop Outlook from Closing? Outlook VBA and Custom Forms 2
M Run external program from Outlook VBA macro Outlook VBA and Custom Forms 5
J Specify Font Name or Face using VBA Macro in Word Outlook VBA and Custom Forms 2
S Custom VBA forms in Outlook--how to call w/macro? Outlook VBA and Custom Forms 1
S macro ist just worling wenn vba editor is open! Outlook VBA and Custom Forms 1
J Outlook macro to run before email is being send Outlook VBA and Custom Forms 0
H Macro to Delete Duplicate items in Outlook calendar where title is the same and date is the same Outlook VBA and Custom Forms 0
X Custom icon (not from Office 365) for a macro in Outlook Outlook VBA and Custom Forms 1
X Run macro automatically when a mail appears in the sent folder Using Outlook 5
mrrobski68 Issue with Find messages in a conversation macro Outlook VBA and Custom Forms 1
G Creating Macro to scrape emails from calendar invite body Outlook VBA and Custom Forms 6
M Use Macro to change account settings Outlook VBA and Custom Forms 0
J Macro to Reply to Emails w/ Template Outlook VBA and Custom Forms 3
C Outlook - Macro to block senders domain - Macro Fix Outlook VBA and Custom Forms 1

Similar threads

Back
Top