Jump to content
Macro Express Forums

Run a Macro using IF statement


Recommended Posts

The way I run my macro now is by using ALT+F3 to search for a certain word. If the word does not exist (in this case the word is phone), the system stops or it crashes. It can not continue without interaction.


This is what I am trying to do. Look for the word Phone, if it exists, continue on with the macro. If it is not there go further down to the phone logic I'm using.



If "Phone" exists, continue with rest of macro after this line.

If NOT go down 10-15 lines to where the address starts.


Is there a way to search for a name within a document with macro commands rather than using ALT+F3?

Can an IF statement go to a particular line of code?


Any help you can offer would be appreciated. I have read information on IF statements, I am just not quite understanding.




Bob Snow

Link to comment
Share on other sites

Skipping ahead is something I just wrote up click here to see what I was talking about.


In a text editor or word processor you can search for the existence of text this way:

  1. In the text body do a CTRL+A to select all the text
  2. Copy text to the clipboard
  3. Copy the clipboard contents to a string variable
  4. Use an If Variable > Contains condition to look for the desired text
  5. Do whatever you like in the condition

If you are only looking for the text in a file and don't have to do anything in the editor you can do it without opening the editor:

  1. Set String Variable from file
  2. If variable contains desired text
  3. Do whatever you like in the condition

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.

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.

  • Create New...