Amerifax-Bob Posted October 5, 2007 Report Share Posted October 5, 2007 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. Example: 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. Thanks, Bob Snow Quote Link to comment Share on other sites More sharing options...
Cory Posted October 7, 2007 Report Share Posted October 7, 2007 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: In the text body do a CTRL+A to select all the text Copy text to the clipboard Copy the clipboard contents to a string variable Use an If Variable > Contains condition to look for the desired text 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: Set String Variable from file If variable contains desired text Do whatever you like in the condition Quote Link to comment Share on other sites More sharing options...
Amerifax-Bob Posted October 7, 2007 Author Report Share Posted October 7, 2007 Thanks for every thing. It will all go into my tool box. Or should I say Text Box. Bob Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.