Jump to content
Macro Express Forums

If Else Stuff


MEnewb1143

Recommended Posts

Trying to do something like this:

 

If search results in Outlook equal '1234' then goto "here"

Or search results in Outlook equal '2345' then goto "here"

Or search results in Outlook equal '3456' then goto "here"

Else stop macro

(This is the rest of the macro or "here)

 

The issue is that when I search for something, I hit F4 and type in '1234' and press enter, or the macro does.

 

Does this make sense? Any ideas?

Link to comment
Share on other sites

I believe that ME Pro (recently released) has a GOTO command. ME 3 does not.

 

ME 3 has a Switch / Case sequence which might help you. It requires coding your GOTO logic in-line with the Case statements; but it allows multiple Case conditions for a single block of executable code, so it's similar to but slightly simpler than coding

IF A

OR

IF B

OR

IF C

.... logic for A/B/C

END IF

 

IF D

OR

IF E

OR

IF F

.... logic for D/E/F

END IF

 

With ME Pro you could presumably combine the Case with the GOTO.

Link to comment
Share on other sites

Read the screen name!! :) I don't program, but I understand the basic stuff. To search in Outlook I use 'F4' which brings up a search window. From there I type in what I want to search for. Forever, it's been the same thing. Recently, it's now four things I need to search for. The format is '000-0000000-0000000' All numbers, no letters. The first three are what I've searched for. When I search, it's either true or false. I don't know how I can search for multiple things. Like I search for '1234' and I either get something or I get a system beep when I don't find anything. Make more sense?

Link to comment
Share on other sites

Read the screen name!! :) I don't program, but I understand the basic stuff. To search in Outlook I use 'F4' which brings up a search window. From there I type in what I want to search for. Forever, it's been the same thing. Recently, it's now four things I need to search for. The format is '000-0000000-0000000' All numbers, no letters. The first three are what I've searched for. When I search, it's either true or false. I don't know how I can search for multiple things. Like I search for '1234' and I either get something or I get a system beep when I don't find anything. Make more sense?

 

 

Hi

 

I think rberq's reply was pretty fair. You say you aren't a programmer, that's fine, we can take that into account, but I think most of the posters here would be happy to encourage you to pick a few things up on your way.

 

Is the problem that you need to determine what the results are to your search and react accordingly?

So, if that's the case you need to pay attention to how the screen changes if results are found, do you get another window, or does the focus change? (I haven't got outlook installed on this machine) I don't think that you can detect a beep with macro express... If you can detect the difference, rberq's post will help you structure the macro so it can move on and carry out the next search.

 

If it seems difficult, staring to automate Outlook with VBA really is something else - just keep plugging.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...