Archive for the ‘Software’ Category


Word: Wildcard find and replace to put parentheses around numbers

June 20, 2019

In another post (, Thomas asked: “I have to find any number within a document and put it into brackets: 2 -> (2); 12 -> (12); 123 -> (123)”. But he wasn’t having any luck.

A standard Find can use ^# to find any single number (but not multiple numbers), but that command doesn’t work in a wildcard find and replace.

Here’s what I came up with instead; it assumes the numbers are surrounded by a space on both sides—it won’t find any numbers that include punctuation marks (e.g. 1,000,000), that start or finish with a punctuation mark (e.g. comma, period, parenthesis, semicolon, etc.), or those that are in a word (e.g. Model1345):

  1. Press Ctrl+H to open the Find and Replace dialog.
  2. Click More, then select the Use wildcards check box.
  3. In Find What, type: ( )(<[0-9]{1,}>)( ) (NOTE: there is a single space between the first set of parentheses and between the third set)
  4. In Replace With, type: \1(\2)\3
  5. Click Find Next, then click Replace once the first is found. Once you’re happy that it works, repeat until you’ve replaced them all.

What the find and replace ‘codes’ mean:

The three elements (each is enclosed in parentheses) of the Find are:

  1. ( ) — For the first and third elements, you type a set of parentheses, with a space inside the parens.
  2. (<[0-9]{1,}>) — The < and > represent the beginning and end of the ‘word’ respectively (in this case, the ‘word’ is a set of numbers with NO punctuation, e.g. 1, 12, 1234, 7896543); [0-9] represents any number from 0 to 9; {1,} says to look for one or more of the same (i.e. numbers) to any length immediately after that number, thus not limiting the find to only single digit numbers.

For the Replace:

  • \1 — Replaces the first element (the space) with itself
  • ( — Inserts an opening parens
  • \2 — Replaces the second element of the Find with what was in the Find (i.e. a number).
  • ) — Inserts a closing parens
  • \3 — Replace the third element (the space) with itself



Word: Find text between quote marks and change to italic

June 5, 2019

All special terms in a Word document I worked on were surrounded by straight double quote marks. I wanted to remove the quote marks and italicise the term. For example, I wanted “term” to become term.

This was a relatively easy task using wildcards in Word’s find and replace, but there are a couple of ‘gotchas’—it won’t catch anything in curly (smart) quotes or inside single quote marks (straight or curly), or if there’s US-style punctuation (e.g. period, comma) at the end, such as “term.” I’ve added alternatives to deal with these situations. It also won’t catch more than one word inside the quote marks, and I don’t have an easy solution for that.

In ALL cases below:

  • you must have Use wildcards checked in the advanced Find and Replace dialog box
  • for the italics, when you’re in the Replace field, select Format > Font> and choose Italic
  • all the double and single straight quotes here DO NOT display correctly, so DO NOT copy/paste from here—instead, type the quote marks in directly from your keyboard

Case 1: Double straight quotes

  • Find: (“)(<*>)(“)
  • Replace: \2

For those preferring to use ACSII codes, a double straight quote mark is ^034.

Case 2: Single straight quotes

  • Find: (‘)(<*>)(‘)
  • Replace: \2

For those preferring to use ACSII codes, a single straight quote mark is ^039.

Note: This may not work—if it doesn’t, try (‘)(*)(‘) as the Find, but be careful when replacing as a single quote mark is also used as an apostrophe. DO NOT do Replace All.

Case 3: Double curly quotes

  • Find: (“)(<*>)(”)
  • Replace: \2

For those preferring to use ACSII codes, an opening double curly quote mark is ^0147 and a closing one is ^0148.

NOTE: It’s easier to copy a curly quote from the main Word document and paste it into the Find. Don’t forget to copy an opening one for the left part of the Find string, and a closing quote for the right part.

Case 4: Single curly quotes

  • Find: (‘)(<*>)(’)
  • Replace: \2

For those preferring to use ACSII codes, an opening single straight quote mark is ^0145, and a closing single straight quote mark is ^0146.

Note: This may not work—if it doesn’t, try (‘)(*)(‘) as the Find, but be careful when replacing as a single quote mark is also used as an apostrophe. DO NOT do Replace All.

NOTE: It’s easier to copy a curly quote from the main Word document and paste it into the Find. Don’t forget to copy an opening one for the left part of the Find string, and a closing quote for the right part.

Case 5: Period or comma inside the closing quote mark

Use the relevant Find from any of the above, depending on the style of quote marks you’re looking for, and add an extra command ([,.]) to find the comma or period too. For straight double quotes, you’d change it to:

  • Find: (“)(<*>)([,.])(“)
  • Replace: \2\3

If you want to keep the punctuation, then you need to add \3 to the Replace. If you don’t want to keep the punctuation, then just leave it as \2. Again, don’t forget to set the Replace to italic font. The end result will be an italicised word with its trailling punctuation also in italics.

If don’t want the punctuation in italics, then you’ll need to run another find/replace using wildcards to change the punctuation back to normal text:

  • Find: ([,.]) (this time, set the Find to italics using Format > Font > Italic)
  • Replace: \1 (for this one, set the Replace to NOT use italics using Format > Font > Regular)




My notes about single touch payroll

June 5, 2019

These notes are for me only. I just needed somewhere to document my process so I don’t have to remember it every month. Oh, and with 26 steps (!!!), this is NOT a ‘single touch’ process, despite what the ATO would lead you to believe!!!!

  1. Open MYOB 19 and do payroll as per normal.
  2. Note the amount, the pay date range, and the date payment was made.
  3. Close MYOB.
  4. Go to online banking and make the payment as per normal.
  5. Open Namich STP Creator.
  6. Click Permanent Data Set.
  7. Click Browse 1 and select the company data set (default location: C:\Users\<username>\Documents\STP_Creator).
  8. Select user, enter password, then click OK.
  9. Click Load Data from MYOB File.
  10. Select ADMINISTRATOR user ID for MYOB and enter password (or skip if no password). Click OK.
  11. Click Save and Close Screen to return to the main STP Creator window.
  12. Click Assemble YTD Data. Check the data is correct, then click Save to return to the main STP Creator window.
  13. Click Assemble W1 and W2 Data.
  14. Enter the pay date range and the date payment was made (see step 2 above), then click OK.
  15. Check the totals match the amount paid via MYOB (step 2 above). Click Save.
  16. Click Assemble Lodgement Data.
  17. Do a final check of the data, then click Lodge. NOTE: If this is the last pay run of the year, click Final Indicator BEFORE clicking Lodge.
  18. Check the declaration box.
  19. Click Sign In.
  20. On the Single Touch log in screen, enter the email address and password for Single Touch, then click Sign-in.
  21. Click Send Code to send a two-factor authentication code to my mobile phone.
  22. When the code arrives, type it into the verification code box. DO NOT press Enter or any other key.
  23. If you get a Server Busy error message (likely), click Retry.
  24. Once you get the message that you’re successfully signed in, click Send.
  25. The status should change to Success and you should get a couple of emails from Single Touch letting you know that a new STP event was generated, and that the data was successfully submitted to and accepted by the ATO.
  26. Click Close on all open STP Creator windows, then close STP Creator.

See also:


Word: Wildcard find and replace for a space after a special character

June 4, 2019

Wildcard find and replace in Word is brilliant, but sometimes it just doesn’t work.

I had set up a find and replace routine to find any of >, <, ≥, and ≤ followed by a space then a number (e.g. > 25). I wanted to remove the space from each I found (e.g. >25). The syntax I used for the find was ([><≥≤])( )([0-9]) (Note: there’s a space inside the second set of parentheses). And the replace I had was \1\3. Looks fine, right? But it didn’t work! Instead, I got some strange results with various numbers preceded by a space replaced with ‘\1\3’. The ≥≤ part worked fine, but not the >< part.

And then I remembered that certain characters have special meaning in Word’s wildcard find and replace—two of which were < for the beginning of a word, and > for the end of a word. No wonder I was getting weird results.

As with any other special characters (e.g. ?, *, [, ], etc.) you have ‘escape’ them for Word to treat them as a normal character, not a special character. The escape character is \ and when I added that in front of each of the special characters, the wildcard find and replace worked as it should.

Here’s what did work:

  • Find: ([\>\<≥≤])( )([0-9])
  • Replace: \1\3 



Word: Quick way to deal with Track Changes

June 4, 2019

If you receive your Word document back from your editor and it’s peppered with track changes (Review tab > All Markup view), you might think you only have two choices:

  • accept them all at once without really checking them (Review tab > Accept > Accept All Changes), but I would only advise this if it’s a short document where there are just a few changes that you’ve agreed to accept, or documents where you totally trust the editor’s judgement; in most cases, this is NOT what you should do
  • accept them one at a time (Review tab > Accept > Accept and Move to Next OR right-click on each change and Accept or Reject the change, then click the Next button in the Changes group on the Review tab). On a document with thousands of changes, this could take a LONG time.

(If you’re going to reject them, then the same as above but choose the Reject option.

However, there is another way to quickly accept/reject a whole group of changes at once.

  1. Go to the Review tab.
  2. Switch to No Markup view.
  3. Read a paragraph or two.
  4. You now have two choices:
    • If you’re happy with the editing, select just that paragraph (or two), then under Review tab > Accept > click Accept Change (DO NOT ‘Accept All Changes’). This accepts all the changes in that selection only.
    • If you’re not happy with how it’s edited, switch back to All Markup view, and accept/reject the individual changes in that paragraph as you normally would.
  5. Repeat steps 2 to 5 for every paragraph/small subset of paragraphs for the rest of the document.

Further resources:

If you’re not sure how to deal with track changes, this overview and these two YouTube videos will help:

[Links last checked June 2019]


Word: Macros to switch from No Markup to All Markup views

June 2, 2019

I worked on a 350p technical report the past two weeks, and was forever switching between No Markup (Final) view and All Markup (Final: Show Markup [i.e. track changes]) view. Moving the mouse to do that got old pretty quick, even though I have that control on my Quick Access Toolbar. What I needed was a keyboard command or two to flip between views. Well, I couldn’t find one! I couldn’t even find the command in the list of all commands. That’s not to say one doesn’t exist—just that I couldn’t find it. Update 5 June 2019: Angela, one of this blog’s subscribers, had a solution that she shared with me. I’ll leave the other macros in this post, but if you want one that just does it all in one toggle command, skip the information below and scroll down to the end under ‘Angela’s solution’.

What to do? Well, one way to get a keyboard shortcut it to create a macro that does what you want to do, and then assign a keyboard shortcut to it. That’s what I ended up doing, except I had to create two macros—one for showing and one for hiding the track changes (I couldn’t figure out how to create a ‘toggle’ macro that used the same command to turn on and off, depending on the current state). And I assigned these keyboard shortcuts that had some logic for me: Ctrl+Shift+{ (i.e. open the bracket) to show the markup, and Ctrl+Shift+} (i.e. close the bracket) to hide the markup. But you can use whatever shortcut that works for you.

The two macros I wrote are below. Once you’ve added them to you VBA area, assign a keyboard shortcut to them from the Customize Ribbon options area.

This macro shows all markup:

Sub MarkupViewAll()
' Shows All Markup view for markup (i.e. shows track changes)
' Created by Rhonda Bracey, CyberText Consulting, 31 May 2019
    With ActiveWindow.View
        .ShowRevisionsAndComments = True
    End With
End Sub

This macro shows the final view:

Sub MarkupViewFinal()
' Shows Final view for markup (i.e. hides track changes)
' Created by Rhonda Bracey, CyberText Consulting, 31 May 2019
    With ActiveWindow.View
        .ShowRevisionsAndComments = False
        .RevisionsView = wdRevisionsViewFinal
    End With
End Sub

I’m sure somebody cleverer with macros than me could write something more elegant (such as using the one macro and keyboard shortcut to toggle the view depending on the current view—if you know how to do that, feel free to contribute in the comments.

Angela’s solution

NOTE: Some of this macro goes off the page—to get it all, copy this macro, don’t retype it.

Sub ToggleMarkupViewAllToFinal()
' Toggles from Markup view all to Markup view final
    ActiveWindow.View.ShowRevisionsAndComments = Not ActiveWindow.View.ShowRevisionsAndComments
End Sub

Thanks Angela! (by the way, I assigned Alt+m as my keyboard shortcut for this—it works a treat!


Word: Apply a template

May 21, 2019

Before Word 2007, it was easy to apply/attach/link to a template via Tools > Options > Templates and Add-Ins. Not quite so simple once Word 2007 was introduced (instructions for Word 2007:

The steps changed again after Word 2010, and the steps below work for all versions of Word for Windows from Word 2010 to Word 365.

First, check if you have the Developer tab on your ribbon. If you do, skip these steps and go to the next set. If you don’t, then follow these steps:

  1. Go to File > Options > Customize Ribbon.
  2. In the right panel, check the Developer checkbox.
  3. Click OK.

Once you’ve got the Developer tab set up:

  1. Click the Developer tab.
  2. Click the Document Template button in the Templates group. This opens the Templates and Add-ins window, which works the same as in earlier versions of Word.
  3. Click Attach.
  4. Find your template, select it, then click Open.
  5. Optional: If you want to apply the template’s style settings to styles of the same name in your document, then check Automatically update document styles.
  6. Click OK.

Note 1: If you checked Automatically update document styles in step 5, then I STRONGLY suggest you turn it off again after you’ve attached the template and updated the styles automatically.

Note 2: Applying a template only affects styles. Other aspects of the template (content, headers/footers, page margins etc.) are not carried across into your existing document.

[Link last checked May 2019]