VBA code (rules) won't work after reboot

First off I am not very knowlegeable about Outook or VBA coding so I 
apologize in advance for missing the obvious.

I have created some rules in outlook (actually exported/imported from a 
functioning account). The rules basically:
-look for an email with an attachment and with a specific word in the 
subject line 
-move the email to a different folder 
-copy the attachment and place it in a shared system folder (done with VBA 
code)

The problem I have is the rules will only work until Outlook is closed down 
or the server is rebooted. After that the rules partially work (the VBA code 
doesn't).  The VBA code is still visible in the editor and the rules still 
point to the applicable VBA script.  However, the code just doesn't run.

To get around the problem, I delete the .otm file and rebuild (via import of 
the .bas files) the VBA project, save it, and close the VBA editor.  Until I 
close down Outlook again the rules all function properly.

Could anyone describe to me where i am going wrong.

Thanks,
John
0
Utf
1/19/2010 7:22:01 PM
outlook.program_vba 490 articles. 0 followers. Follow

2 Replies
1103 Views

Similar Articles

[PageSpeed] 33

Does other VBA code run? If not, check your macro security settings. You 
might also put a Debug.Print statement in the Application_Startup event 
handler to "wake up" the VBA environment.
-- 
Sue Mosher, Outlook MVP
   Author of Microsoft Outlook 2007 Programming:
     Jumpstart for Power Users and Administrators
    http://www.outlookcode.com/article.aspx?id=54


"John66" <John66@discussions.microsoft.com> wrote in message 
news:4D4B6B42-9683-4F2F-A810-BB9BBD2F0512@microsoft.com...
> First off I am not very knowlegeable about Outook or VBA coding so I
> apologize in advance for missing the obvious.
>
> I have created some rules in outlook (actually exported/imported from a
> functioning account). The rules basically:
> -look for an email with an attachment and with a specific word in the
> subject line
> -move the email to a different folder
> -copy the attachment and place it in a shared system folder (done with VBA
> code)
>
> The problem I have is the rules will only work until Outlook is closed 
> down
> or the server is rebooted. After that the rules partially work (the VBA 
> code
> doesn't).  The VBA code is still visible in the editor and the rules still
> point to the applicable VBA script.  However, the code just doesn't run.
>
> To get around the problem, I delete the .otm file and rebuild (via import 
> of
> the .bas files) the VBA project, save it, and close the VBA editor.  Until 
> I
> close down Outlook again the rules all function properly.
>
> Could anyone describe to me where i am going wrong.
>
> Thanks,
> John 


0
Sue
1/19/2010 8:14:59 PM
Thank you so very much for your help!

The security settings were the problem.

"Sue Mosher [MVP]" wrote:
> Does other VBA code run? If not, check your macro security settings. You 
> might also put a Debug.Print statement in the Application_Startup event 
> handler to "wake up" the VBA environment.
> -- 
> Sue Mosher, Outlook MVP
>    Author of Microsoft Outlook 2007 Programming:
>      Jumpstart for Power Users and Administrators
>     http://www.outlookcode.com/article.aspx?id=54
> 
> 
> "John66" <John66@discussions.microsoft.com> wrote in message 
> news:4D4B6B42-9683-4F2F-A810-BB9BBD2F0512@microsoft.com...
> > First off I am not very knowlegeable about Outook or VBA coding so I
> > apologize in advance for missing the obvious.
> >
> > I have created some rules in outlook (actually exported/imported from a
> > functioning account). The rules basically:
> > -look for an email with an attachment and with a specific word in the
> > subject line
> > -move the email to a different folder
> > -copy the attachment and place it in a shared system folder (done with VBA
> > code)
> >
> > The problem I have is the rules will only work until Outlook is closed 
> > down
> > or the server is rebooted. After that the rules partially work (the VBA 
> > code
> > doesn't).  The VBA code is still visible in the editor and the rules still
> > point to the applicable VBA script.  However, the code just doesn't run.
> >
> > To get around the problem, I delete the .otm file and rebuild (via import 
> > of
> > the .bas files) the VBA project, save it, and close the VBA editor.  Until 
> > I
> > close down Outlook again the rules all function properly.
> >
> > Could anyone describe to me where i am going wrong.
> >
> > Thanks,
> > John 
> 
> 
> .
> 
0
Utf
1/19/2010 9:31:01 PM
Reply:

Similar Artilces:

How to Stop Worksheet_Change event from running during code execution
I'm sorry If I've asked this before but I can't find an answer to it. I have the following 2 events in a worksheet module.... Private Sub Worksheet_Change(ByVal Target As Excel.Range) Private Sub Worksheet_SelectionChange(ByVal Target As Range) I run some codes, either in UserForms or general procedures that make changes to this worksheet. Q. Is there a way to by-pass those two events somehow? As an example I have a uf that comes up if a cell is selected in that sheet. So I need those worksheet_Change events to work at that point. But then, the uf does some stuff like inputing ...

VBA code to say Yes or No if any VBA code is present in ActiveWork
Using XL 2003 & 97 Would like hit Ctrl+Shift+V and have an answer either yes or no as to the presence of Any VBA code in the Active Workbook. I do know that about the VBA editor/Explorer or to press the Run Macro button and get a list from various sources . I would like to stay at the keyboard and process a series of macros including one to let me know if I even need to evoke the VBA explorer. TIA Dennis There is no bootstrap macro to tell you whether you have macros or not. If there were there would be no limit to virus writers. --- HTH, David McRitchie, Microsoft MVP - Excel ...

create a rule for *@domain.dns
hi, i'd like to create a mail rule in my outlook2003. All mails from domain.dns should be moved to a specific folder. but what is the wildcast character? i tried *@domain.dns and @domain.dns as well as domain.dns but it seems that only complete adresses like user@domain.dns are allowed. but i don't know "all" adresses of that company. So how to create such a rule? thanks for any help on this. Jan Jan Schmidt wrote: > hi, > > i'd like to create a mail rule in my outlook2003. > All mails from domain.dns should be moved to a specific folder. >...

Payout reason codes
Can someone point me to where in the database the payout reason codes are stored? thanks, Store Ops Manager, Database, Reason Codes, Type = Payout "Jason" wrote: > Can someone point me to where in the database the payout reason codes are > stored? > > thanks, Thanks. What I meant (and asked poorly) was if I wanted to design a custom report to show that info where would I need to look? Thanks, "Wendy_I" wrote: > Store Ops Manager, Database, Reason Codes, Type = Payout > > > > "Jason" wrote: > > > Can someo...

Sort several workbooks using code
I am looking to run code that will sort several workbooks even when they are closed. The code would be executed via a master workbook which will also be sorted. Is this possible? I'm not aware of sorting records in a CLOSED workbook, but what you can do is this. Create some button on the master workbook and let it open the other workbook, sort the other workbook and close the other workbook. Accompanied with Application.ScreenUpdating (but also depending on the amount of records) you will hardly notice the sorting actions. Does this help ? -- Regards; Mark ...

Hyperlinks that I recieve in e-mails don't work in outlook 2003
LMT <LMT@discussions.microsoft.com> wrote: <nothing> Ask your question in the body of the message, not the subject. If you're using Internet Explorer, try this: click Tools>Internet Options>Programs>Reset Web Settings -- Brian Tillman "Brian Tillman" wrote Thanks Brian worked great. LMT > LMT <LMT@discussions.microsoft.com> wrote: > <nothing> > > Ask your question in the body of the message, not the subject. > > If you're using Internet Explorer, try this: click Tools>Internet > Options>...

Print, Merged Cells, and VBA
Hello I'm looking for a code that will help me with a print job for a worksheet. There are a lot of merged cells and a lot of "IF"s to be used in the VBA for range selection. Thanks in advance, Sarr ...

SQL Not Working
What is wrong with this SQL? I am trying to use a Median function and trying to have the median calculate for each JobCode. SELECT tEmployeeMasterCopy.JobCode, (SELECT Median("tEmployeeMasterCopy","HourlyRate") FROM tEmployeeMasterCopy as M1 WHERE M1.JobCode = tEmployeeMasterCopy.JobCode) AS MedianByJobCode FROM tEmployeeMasterCopy GROUP BY tEmployeeMasterCopy.JobCode; Thanks in advance. It seems that (SELECT Median("tEmployeeMasterCopy","HourlyRate") FROM tEmployeeMasterCopy as M1 WHERE M1.JobCode = tEmployeeMasterCopy.JobCode) ...

Use VBA to update Access table or Query from Excel
Can I use VBA to update Access table or Query from Excel? Thanks in advance Hi Leungkong, > Can I use VBA to update Access table or Query from Excel? Of course, using ADO or DAO. See: http://www.erlandsendata.no/english/index.php?d=envbadacexportado Regards, Jan Karel Pieterse Excel MVP http://www.jkp-ads.com Hi Jan, Thanks. I think ADO is what I want. But I am not only want to export from excel to access. I want to edit some data in access table. For example, Access has a table "ProductList" I want to use Excel to call the product by "Pro...

VBA and Scheduled task in Outlook
Hi, how can I: a) pull the query from somewhere and send it by e-mail automatically. E.g. I want to take a temperature table from http://www.wunderground.com/history/airport/EHAM/2009/7/10/DailyHistory.html?req_city=NA&req_state=NA&req_statename=NA where 2009/7/10 is the date of yesterday put it into an e-mail and send it automatically each day at 8 o'clock? b) if this is not possible, how can I send an e-mail with the attachment c:\Documents\query20090710.xls each day at 8 o'clock? my boss wants this automatized, I know how to write the VBA code for Excel, but don'...

2007 search not working with Vista with new profile
It stopped working after I deleted my mail profile and started from scratch again. Who would have guessed doing that would break the search feature? I thought maybe it was indexing, but this is even after indexing has finished. Take any word from any subject line in any message and put that same word into the search box and it doesn't find the message. Using Vista with Outlook 2007 with Exchange 2003. Also the desktop search no longer looks inside my emails. Any ideas? Is there a cheat to make Outlook 2007 use the old simple search feature we love/hate from Outlook 2003 and befor...

How get rid of reveal codes?
How get rid of reveal codes? the symbols are all over my document!! How do I get rid of them?? Try:- ALT + F9 If my comments have helped please hit Yes. Thanks. "Christa" wrote: > How get rid of reveal codes? the symbols are all over my document!! How do > I get rid of them?? Ctrl+* or Ctrl+Shift+8. See http://word.mvps.org/FAQs/Formatting/NonPrintChars.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "Christa" <Christa@discussions.microsoft.com> wrote in mes...

vba select field
Hi, having a button on a form, is it possible to select only some fields (all from the same table) of the current record instead of all fields? I've tried this code: RunCommand acCmdSelectRecord RunCommand acCmdCopy Forse dipende dei dati nel record. but it selects ALL fields in the form. Thank you. Remigio hi, On 10.04.2010 18:01, remigio wrote: > having a button on a form, is it possible to select only some fields > (all from the same table) of the current record instead of all fields? > I've tried this code: > > RunCommand acCmdSelectRecord &...

VLOOKUP in VBA
On the worksheet I can insert in a cell =VLOOKUP(C5, Hobokee.xls!AcsLow, 2) and it works perfectly, looks up the value in column 2 of the range named AcsLow in the same workbook. But elswhere I want in a macro to lookup the same table and assign the result to a variable BalAmt. BalAmt = VLOOKUP(AccNum, Hobokee.xls!AcsLow, 2) does not work. It gives a function not defined error on Hobokee. If instead of Hobokee I put Workbooks("Hobokee"), it gives function not defined error for VLOOKUP which it changes to VLookup. I have been overVLOOKUP in the Help file and see nothing wrong. W...

Excel VBA/Macro programming for beginners
Hi all, I know a bit VB 6.0 programming. Will it help me to write exce vba/macro(same thing?).can anybody help me by providing some fre websites where i can have informations/codes for VBA/macro. Please tell me how could i make a *command Button * in a cell in th excel sheet -- sdebu_200 ----------------------------------------------------------------------- sdebu_2000's Profile: http://www.officehelp.in/member.php?userid=430 View this thread: http://www.officehelp.in/showthread.php?t=118812 Posted from - http://www.officehelp.i Try David McRitchie's "getting started with mac...

Turn pc speaker on/off with vba code
Is this possible? Thanks I found something here on how to do it withVBScript. You can probably modify it to work in VBA http://www.pcreview.co.uk/forums/thread-1468591.php -- HTH, Barb Reinhardt "David" wrote: > Is this possible? > Thanks Thanks Barb I'll have a go (I need to improve my web searching skills) "Barb Reinhardt" wrote: > I found something here on how to do it withVBScript. You can probably modify > it to work in VBA > > http://www.pcreview.co.uk/forums/thread-1468591.php > -- > HTH, > ...

Loading a Form from VBA
Hi all, I'd like a module to open and load a form in my Access 2003 database... How can I do this? Use the OpenForm method. Look in the Help file for details. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Mike" <michael.leon.schwartz@gmail.com> wrote in message news:1184770076.109526.207900@o11g2000prd.googlegroups.com... > Hi all, I'd like a module to open and load a form in my Access 2003 > database... How can I do this? > On Jul 18, 10:58 am, "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com&g...

Works Calandar
Help! I don't know how this discussion group works. I have clicked on all the links for Microsoft Works but never see "works" in the index to choose from for discussions. I am having trouble with printing the calandar all of a sudden. It says to wait while it sets up calandar for printing and never goes away. I saw the download for this problem, however it was in 2002, but I went ahead and downloaded it, but it has not resolved the problem. I did recently install the windows upate for explorer 7. Can anyone help me or direct me to where I need to go? My email addre...

Publisher 2007 "working folder"
How do I set a new "working folder" in Pub 07? There are no "File Locations" settings under "Options" as there have been in past versions for opening and saving files somewhere other than My Documents. It's a real pain to constantly have to navigate through 3 folders every time I want to open or save a project. Help!! It isn't an option in 2007. A workaround, File, save as, navigate to the folder you want as default, right-click the "Look in:" task pane, add the folder. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msaue...

Excel and VBA
I am very interested in learning more about using VBA in office, especially Excel. Can you post some resources (online, books, etc) that can be used to help learn about using Visual Basic in office. Thanks! Here's a good place to start: http://www.contextures.com/xlbooks.html Does that help? *********** Regards, Ron XL2002, WinXP "Bob Sinclair" wrote: > I am very interested in learning more about using VBA in office, especially > Excel. Can you post some resources (online, books, etc) that can be used to > help learn about using Visual Basic in office. >...

VBA Customization
Is there a way to get the name of the current company through VBA in Great Plains 8.0? Thanks for all your help. open GreatPlains. Add the current window, it will add the Toolbar then add fields choose the company name on the top left after the user id. >-----Original Message----- >Is there a way to get the name of the current company through VBA in Great >Plains 8.0? > >Thanks for all your help. > > > >. > Thanks. I tried, but I couldn't add company name to the field list. It opens up the login screen instead. Any thoughts? Thanks again. "ger...

Rules for outgoing mail?
Hi, I'm almost sure that this can't be done but I thought I'd ask just in case as it would be a neat feature IMO. Here's the scenario. I'm running Outlook 2003. I have 4 e-mail accounts at home, one of which is for work only. All my work only e-mails are sent to recipients on a specific domain. The problem is that when sending a work e-mail I sometimes forget to switch from my home e-mail account (which is the default), to my work one before I send the message. Is there any way of setting a rule to apply to outgoing mail so that it's always sent from the correct ac...

Form Controls vs VBA controls
I am new to VBA so just finding my feet, can anyone help me with th differences between an excel control (i.e. one from the form toolbox lets say a checkBox and a vba checkBox? From trying the two controls the I have noticed is that you canno capture the change event of the VBA checkbox in the code module, it ha to be done via the sheet (i.e. checkbox on sheet1, code goes in chang event on sheet1) the control is placed on, is this correct? What woul you do if you have three sheets with the same controls just differen data, do you really have to code the control 3 times? The excel control ho...

Outlook Local Rules? #2
Hello, I posted the message below and got 2 replies. When I try to read the replies I get a message that says "Message Unavailable" so...Here is the question again. Thanks Mike Hello, I have a collegue that swears that his rules only work when his machine is on and he is logged in. Is that possible? Is there such a thing as a locally stored rule? Thanks Mike Mike Burke <mburke@utmb.edu> wrote: > I posted the message below and got 2 replies. When I try > to read the replies I get a message that says "Message > Unavailable" so...Here is the que...

Run VBA without show
I want excel to run the VBA code without showing me what it is doing. Which code should i use for that? Sub RunWithoutShow() Application.ScreenUpdating = False 'Paste the vba code here 'end of code 'Change screenupdating property to true Application.ScreenUpdating = True End Sub I hope this helps... Selva V Pasupathy For more on Excel, VBA, & other Resources Please visit: http://socko.wordpress.com You may also (inserting into quote from code example bellow from Socko) Use Application.Visible property to hide the application entirely Sub RunWithoutShow() Appli...