+ Reply to Thread
Results 1 to 4 of 4

enable and disable macro

  1. #1
    BillyRogers
    Guest

    enable and disable macro

    I posted this in the outlook forum and haven't heard anything. I'm sure the
    code would be the same in any offce program.
    ******************************************************


    I have a macro that i build for someone that notifies them of report request
    hitting a public folder. I've installed the macro on three employee's
    computers here and commented out the line that starts the macro on two of
    them.

    The reason I need it on these other computers is if the person who normally
    assigns reports is out of the office we need someone else to moniter the
    request while he is gone.

    Is there some way for the users to be able to easily enable and disable the
    macro though a menu selection or button?

    I don't really like the idea of showing them how to go into the VBE and
    comment out the line that triggers the macro.





    Public WithEvents myOlItems As Outlook.Items



    Private Sub Application_Startup()


    '****This next line is the one I comment out to disable the macro******

    Set myOlItems = Outlook.Application.GetNamespace("MAPI").Folders("Public
    Folders").Folders("All Public
    Folders").Folders("CompanyName").Folders("PTI-Data Resources").Items

    End Sub


    Private Sub myOlItems_ItemAdd(ByVal item As Object)


    'These lines pull info from email

    --
    Billy Rogers

    Dallas,TX

    Currently Using Office 2000

  2. #2
    bigwheel
    Guest

    RE: enable and disable macro

    Would it be a problem if the macro was enabled on all three computers?

    "BillyRogers" wrote:

    > I posted this in the outlook forum and haven't heard anything. I'm sure the
    > code would be the same in any offce program.
    > ******************************************************
    >
    >
    > I have a macro that i build for someone that notifies them of report request
    > hitting a public folder. I've installed the macro on three employee's
    > computers here and commented out the line that starts the macro on two of
    > them.
    >
    > The reason I need it on these other computers is if the person who normally
    > assigns reports is out of the office we need someone else to moniter the
    > request while he is gone.
    >
    > Is there some way for the users to be able to easily enable and disable the
    > macro though a menu selection or button?
    >
    > I don't really like the idea of showing them how to go into the VBE and
    > comment out the line that triggers the macro.
    >
    >
    >
    >
    >
    > Public WithEvents myOlItems As Outlook.Items
    >
    >
    >
    > Private Sub Application_Startup()
    >
    >
    > '****This next line is the one I comment out to disable the macro******
    >
    > Set myOlItems = Outlook.Application.GetNamespace("MAPI").Folders("Public
    > Folders").Folders("All Public
    > Folders").Folders("CompanyName").Folders("PTI-Data Resources").Items
    >
    > End Sub
    >
    >
    > Private Sub myOlItems_ItemAdd(ByVal item As Object)
    >
    >
    > 'These lines pull info from email
    >
    > --
    > Billy Rogers
    >
    > Dallas,TX
    >
    > Currently Using Office 2000


  3. #3
    Norman Jones
    Guest

    Re: enable and disable macro

    Hi Billy,

    See Chip Person's page on 'Programming To The Visual Basic Editor' at:

    http://www.cpearson.com/excel/vbe.htm



    ---
    Regards,
    Norman



    "BillyRogers" <[email protected]> wrote in message
    news:[email protected]...
    >I posted this in the outlook forum and haven't heard anything. I'm sure
    >the
    > code would be the same in any offce program.
    > ******************************************************
    >
    >
    > I have a macro that i build for someone that notifies them of report
    > request
    > hitting a public folder. I've installed the macro on three employee's
    > computers here and commented out the line that starts the macro on two of
    > them.
    >
    > The reason I need it on these other computers is if the person who
    > normally
    > assigns reports is out of the office we need someone else to moniter the
    > request while he is gone.
    >
    > Is there some way for the users to be able to easily enable and disable
    > the
    > macro though a menu selection or button?
    >
    > I don't really like the idea of showing them how to go into the VBE and
    > comment out the line that triggers the macro.
    >
    >
    >
    >
    >
    > Public WithEvents myOlItems As Outlook.Items
    >
    >
    >
    > Private Sub Application_Startup()
    >
    >
    > '****This next line is the one I comment out to disable the macro******
    >
    > Set myOlItems = Outlook.Application.GetNamespace("MAPI").Folders("Public
    > Folders").Folders("All Public
    > Folders").Folders("CompanyName").Folders("PTI-Data Resources").Items
    >
    > End Sub
    >
    >
    > Private Sub myOlItems_ItemAdd(ByVal item As Object)
    >
    >
    > 'These lines pull info from email
    >
    > --
    > Billy Rogers
    >
    > Dallas,TX
    >
    > Currently Using Office 2000




  4. #4
    BillyRogers
    Guest

    RE: enable and disable macro

    Yes, because- most importantly --the other users (the backup users) don't
    need to be bothered by the form popping up on their screen every time a
    report request hits the folder. Also, the program is only made for one user,
    if two people are running it they could both select the request in the form
    that pops up and click the button that turns it into a task
    request.........then there would be a report assigned twice and maybe not to
    the same person.


    --
    Billy Rogers

    Dallas,TX

    Currently Using Office 2000


    "bigwheel" wrote:

    > Would it be a problem if the macro was enabled on all three computers?
    >
    > "BillyRogers" wrote:
    >
    > > I posted this in the outlook forum and haven't heard anything. I'm sure the
    > > code would be the same in any offce program.
    > > ******************************************************
    > >
    > >
    > > I have a macro that i build for someone that notifies them of report request
    > > hitting a public folder. I've installed the macro on three employee's
    > > computers here and commented out the line that starts the macro on two of
    > > them.
    > >
    > > The reason I need it on these other computers is if the person who normally
    > > assigns reports is out of the office we need someone else to moniter the
    > > request while he is gone.
    > >
    > > Is there some way for the users to be able to easily enable and disable the
    > > macro though a menu selection or button?
    > >
    > > I don't really like the idea of showing them how to go into the VBE and
    > > comment out the line that triggers the macro.
    > >
    > >
    > >
    > >
    > >
    > > Public WithEvents myOlItems As Outlook.Items
    > >
    > >
    > >
    > > Private Sub Application_Startup()
    > >
    > >
    > > '****This next line is the one I comment out to disable the macro******
    > >
    > > Set myOlItems = Outlook.Application.GetNamespace("MAPI").Folders("Public
    > > Folders").Folders("All Public
    > > Folders").Folders("CompanyName").Folders("PTI-Data Resources").Items
    > >
    > > End Sub
    > >
    > >
    > > Private Sub myOlItems_ItemAdd(ByVal item As Object)
    > >
    > >
    > > 'These lines pull info from email
    > >
    > > --
    > > Billy Rogers
    > >
    > > Dallas,TX
    > >
    > > Currently Using Office 2000


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1