Question: I'm using the following vba to simply click on a button and open a command prompt window, however when I do so, it opens it up in onenote instead of locally. Why is this the default behavior? I was under the impression shell opened it up locally.

```
Private Sub CMD_PW2_Click()

Set oShell = CreateObject("Shell.Application")
oShell.ShellExecute "cmd.exe"

End Sub

```

The result of the above is that it opens up CMD pointing from onenote and not local C:\

Answer: 
You need to make sure "our" is with space boundaries, like this:

```
our = '(^|\s+)our(\s+)?\W+(?P<after>(?:\w+\W+){,4})'

```

specifically `(^|\s+)our(\s+)?` is where you need to play, the example only handles spaces and start of sentence, but you might need to extend this to have quotes or other special characters.
Here is the generic code for finding the n number of words after a specific 'x' word in the string. It also accounts for multiple occurrences of 'x' as well as for non-occurrence.

```
def find_n_word_after_x(in_str, x, n):
    in_str_wrds = in_str.strip().split()
    x = x.strip()
    if x in in_str_wrds:
        out_lst = []
        for i, i_val in enumerate(in_str_wrds):
            if i_val == x:
                if i+n < len(in_str_wrds):
                    out_str = in_str_wrds[i+1:i+1+n]
                    out_lst.append(" ".join(out_str))
        return out_lst
    else:
        return []
str1 = "our w1 w2 w3 w4 w5 w6"
str2 = "our w1 w2 our w3 w4 w5 w6"
str3 = "w1 w2 w3 w4 our w5 w6"
str4 = "w1"

print(find_n_word_after_x(str1, 'our', 4))
print(find_n_word_after_x(str2, 'our', 4))
print(find_n_word_after_x(str3, 'our', 4))
print(find_n_word_after_x(str4, 'our', 4))

```

Generated Output:

```
['w1 w2 w3 w4']
['w1 w2 our w3', 'w3 w4 w5 w6']
[]
[]

```