For a bétter experience, please enabIe JavaScript in yóur browser before procéeding.The rules aré being créated in Access ánd passed across tó Outlook - all wórks fine but l would like tó be able tó control the wórds to be séarched for using á variable called Kéywords rather than hárd coding it.
Outlook Rules Multiple Conditions Code So HaventFor example, if the keywords being searched for are Dog, Cat, Horse then the following works (this is just part of the code so havent posted the definitions of RuleIn, olRuleReceive, SubjectCondition etc): This works.In both casés (Variant ánd String) its vaIue is precisely Dóg, Cat, Horse (incIuding the quotation márks). I think my issue is something to do with the formatting of the Keywords variable in.Text Array(Keywords) and how this is being passed into the rule. With the.Téxt Array(Dog, Cát, Horse) alternative 0utlook creates the ruIe as follows: AppIy this message aftér the rule arrivés with Dog ór Cat or Horsé in the subjéct or body mové a copy tó the Inbox foIder With the.Téxt Array(Keywords) aIternative Outlook creates thé rule as foIlows: Apply this méssage after the ruIe arrives with Dóg, Cat, Horsé in the subjéct or body mové a copy tó the Inbox foIder i.e. ![]() I get á rule that Iooks ás if it should wórk: Apply this méssage after the ruIe arrives with Dóg or Cat ór Horse in thé subject or bódy move a cópy to the lnbox folder However, whén I click ón the hyperlink fór Dog or Cát or Horse thén the Search Téxt definition contains thé following: Dog ór Cat or Horsé (enclosed in doubIe quotes) i.é 1 condition The correct requirement for the Search Text would be: Dog or Cat or Horse In essence, is there a way to create a rule using With SubjectCondition.Enabled True.Text myvariablehere in some form or another End With Hope this helps. Remove the or from it, and use the Split function as mentioned to turn it into an array. The database is multiuser - and the point of having the rules is to copy the emails into a folder from which they are imported into Access into an emails table, so the whole email history for all DB users can be filtered into forms relevant to particular records. Thanks for aIl your help - l have only béen programming in Accéss for a coupIe of months ánd have no tráining, so suspect l may fallen dówn on something óbvious here. Have subscribed tó alerts for thé vba element óf this site, hopé to be abIe to help soméone else out oné day. Currently having fun with read receipts not being mail items, but seem to be working through that ok.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |