About

I'm Mike Pope. I live in the Seattle area. I've been a technical writer and editor for over 35 years. I'm interested in software, language, music, movies, books, motorcycles, travel, and ... well, lots of stuff.

Read more ...

Blog Search


(Supports AND)

Feed

Subscribe to the RSS feed for this blog.

See this post for info on full versus truncated feeds.

Quote

Because novels don't get yanked out of the front of the brain, they can't be bullied into existence by increased focus or a Calvinist work ethic. A lot of what you need is in that great junkshop of memory and experience and emotion that's located in the back of the mind, and it's a place that can't be systematized, made orderly. You can't go in there looking for one thing and hope to find it. All you can do is browse, see what looks interesting, hold it up to the dim light and ask yourself what its relevance might be to the task at hand.

Richard Russo



Navigation





<October 2024>
SMTWTFS
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

Categories

  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  

Contact Me

Email me

Blog Statistics

Dates
First entry - 6/27/2003
Most recent entry - 9/4/2024

Totals
Posts - 2655
Comments - 2677
Hits - 2,700,797

Averages
Entries/day - 0.34
Comments/entry - 1.01
Hits/day - 348

Updated every 30 minutes. Last: 1:15 PM Pacific


  08:46 PM

This is mostly a note to myself so that I don't have to look this up the next time I have to do this. The task is to have a quick way to get directly to the Customize Keyboard dialog box in Microsoft Word:

You use this dialog box to assign new (custom) keyboard shortcuts to Word commands or to macros. The usual way to get to this dialog is through the File menu:

  1. Choose File > Options.
  2. Click the Customize Ribbon tab.
  3. Click the Customize button next to Keyboard shortcuts.

This works but is tedious. Instead, you can assign a keyboard shortcut to get directly to this dialog. The trick is to use the Customize Keyboard dialog to assign a shortcut to the ToolsCustomizeKeyboard command:

Don't forget to click the Assign button!

Credits: I learned all of this from Stefan Blom's answer on a thread on the Microsoft Community site.

[categories]  

|


  09:32 PM

On Twitter recently, DeAnna Burghart reminded us that if you use Microsoft Word, it's important to back up your Normal.dotm file. If the file is overwritten or corrupted, you lose your macros, your keyboard shortcuts, and other goodies that editors rely on.

I've experienced that problem, gah. So a while back, I set up Windows so that it automatically backs up my Normal.dotm file several times a day. I thought it might be useful to show other people how I did this.

Sad note: The information in this post applies only to Windows. I'm sure there's a way to do this on the Mac, probably involving Python or Bash and one of several ways to run a scheduled task.

I realize that this is a long post and therefore looks complicated. It isn't, I promise! I added some extra steps to test as you go to try to make sure that you don't Experience Disappointment.

Update: I created a video version of this tutorial!

Background

To back up your Normal.dotm file, you copy it from its default location (i.e., where Word looks for it) to some other location. AFAIK, the default location is always this:

DRIVE:\Users\YOUR-USER-NAME\AppData\Roaming\Microsoft\Templates

For example, my Normal.dotm file is here:

C:\Users\Mike\AppData\Roaming\Microsoft\Templates

You can certainly copy the file manually. But you can also automate the copy process so that Windows copies the file for you. You might sometimes forget to back up your file by hand, but if you automate the process, you never need to worry about it.

What I did—and what I'll show you here—is that I created a script. The script doesn't just copy the Normal.dotm file to another folder. During the copy process, it names the backup file by adding a date and time stamp. For example, the script creates a file that has a name like this:

Normal(2021-04-26 17_49).dotm

You can see that the filename includes the date (Apr 26, 2021) and time (5:49 pm). Timestamping the backup files has two advantages:

  • Each time you run the backup, you make a new, different backup file. This can be useful if Normal.dotm gets corrupted—you have multiple backup versions of the file, some of which (hopefully) are older than when the corruption occurred.
  • You know when the backup was made.

I use two technologies for the automated backup:

  • PowerShell. This is a programming language that lets you automate Windows tasks like copying files. PowerShell has been in Windows since Windows 7, so you don't need to install anything. I have the complete script in this post, so you don't need to know PowerShell; you can just copy and paste the script.
  • Windows Task Scheduler. This is a Windows utility that lets you run tasks—for example, a script—at specific times or at intervals.

Create the PowerShell script

  1. Create a folder named C:\backup on your computer to copy the backup files to.

    You don't have to use this folder; you can use any folder you like. Just make sure that the folder already exists. (The script won't create it.) If you don't use C:\backup, you need to make some minor changes later.

  2. Open a text editor (for example, Notepad ... don't use Word for this), create a new file, and then copy the following script into it:
    # PowerShell script to back up the Word Normal template (Normal.dotm)
    # 2020-Apr-26 Mike Pope
    
    $bu_path = "C:\backup"
    
    $bu_datetime = Get-Date -Format "yyyy-MM-dd HH_mm"
    $source_file = $env:appdata + "\Microsoft\Templates\Normal.dotm"
    $dest_filename = $bu_path + "\Normal(" + $bu_datetime + ").dotm"
    Write-Output $dest_filename
    Copy-Item -Path $source_file -Destination $dest_filename
  3. If you don't want to use the C:\backup folder, change the path in the third line (the one that starts with $bu_path =). Make sure that you don't add a trailing backslash (\) to your path.
  4. Save the file to the C:\backup folder (or your alternative) using the following name:

    back-up-normal-template.ps1

    The .ps1 extension is used for PowerShell scripts.

  5. Close the text editor.

Test the script

Before you create a scheduled task for the script, it's a good idea to make sure it's working on your computer.

  1. Open a Windows command window. (Press Windows+s, then type CMD). You see a command line:

  2. Enter the following command (better yet, copy and paste it):

  3. powershell.exe -ExecutionPolicy Bypass -File "C:\backup\back-up-normal-template.ps1"

    Again, if you're not using C:\backup, substitute your folder name.

    The command invokes PowerShell and tells it to run the script that's in the back-up-normal-template.ps1 file that you created earlier. The ExecutionPolicy argument tells PowerShell that your script is safe; if you don't include this part, PowerShell will refuse to run the script due to security concerns.

    If all goes well, the script displays the name of the backup file, like this:

    C:\backup\Normal(2021-04-26 17_59).dotm

    If you see red text, read it carefully. Carefully check the command that you entered. You might also need to fix the script itself (the .ps1 file). Some possibilities:

    • The script you used earlier assumes that the Normal.dotm file is in the default location. If the file is in a different location, it's possible the script isn't finding it.
    • If you're not using the C:\backup folder, did you fix up the script to reflect the folder that you are using?

    You must resolve any errors before you can proceed.

  4. If the script appeared to run correctly, look in the C:\backup folder (or the folder you are using instead). Do you see a .dotm file that starts with Normal followed by a date and time? If so, everything is working.

Schedule the backup

You can now configure Windows to run your script at intervals. You do this by creating a scheduled task. When you create the task, you specify what you want to run (the PowerShell command that you just tested) and when you want to run it.

  1. Open the Task Scheduler app. (Press Windows+S, then type Task Scheduler.)

  2. In the folder tree on the left, right-click Task Scheduler Library and then click New Folder. Name the new folder My Tasks. This step isn't essential, but it makes it easier for you to find your custom task later if you want to modify it.

  3. Right-click the My Tasks folder and click Create Task. This opens the Create Task dialog, which has several tabs that you'll be working in.

    Note: Don't close the Create Task dialog (that is, don't click OK), until you've done all the steps.

  4. In the General tab, do the following:

    1. In the Name box, enter the name BackupNormalTemplate.

    2. In the Description box, enter details about what this task is about.

  5. Go to the Actions tab and click New. This is where you specify what you want to run—namely, the PowerShell script.

    1. In the Program/script box, enter powershell.exe.

    2. In the Add arguments box, enter the following:

      -ExecutionPolicy Bypass -File "C:\backup\back-up-normal-template.ps1"

      These settings specify that you want to run the PowerShell script that you tested at the command line earlier.

    3. Click OK to close the New Action dialog and return to the Create Task dialog.

  6. Go to the Triggers tab and click New. This is where you specify when (how often) to run your script.

    1. Under Advanced settings, select the checkbox next to Repeat task every.

    2. Enter an interval for how often you want to run the script. For example, to run the script twice a day, enter 12 hours. (It doesn't look like it, but you can type in that box.)

    3. In the for a duration of list, choose Indefinitely. This tells Windows to keep running the script until you change the interval or delete the scheduled task.

  7. Click OK to close the New Trigger dialog.

  8. In the Create Task dialog box, click OK.

Note: Don't close the Task Scheduler window yet.

Test the scheduled task

You know that the script runs; now you want to make sure that the scheduled task works.

  1. In the Task Scheduler, in the file tree, click the MyTasks folder. The list of scripts in that folder is displayed on the right.

  2. In the right-hand pane, right-click the BackupNormalTemplate task and then click Run.

    The PowerShell scripting window appears briefly, then vanishes.

  3. Go to the C:\backup folder and check that another backup copy of the Normal.dotm file has been saved.

    If this worked, you should be all set.

  4. Close the Task Scheduler app.

You probably want to check the C:\backup folder tomorrow and the next day to make sure that the script is writing out backup files at regular intervals.

If you need to recover a Normal.dotm file, go to the C:\backup folder, rename one of the backup files to just Normal.dotm, and then copy it back to the folder where Word keeps the template.

Hopefully you'll never need to do that. But if you do, you'll have a recent backup available!

[categories]   , ,

[2] |


  09:38 PM

A little-known fact is that I have a number of videos on YouTube about using Microsoft Word. ("Little-known" as evidenced by the analytics, haha.) It seems that I should probably let more people know about them! So here's a blog post that catalogs the videos I have so far.

Using styles

Why use styles?

An overview of why styles are awesome and wonderful and why you should use them.

Types of styles

About the different types of styles (paragraph, character, linked, table, and list styles), and how and when you use them.

Ways to apply styles

Reviews the several different ways that you can apply styles in Microsoft Word—the Quick Styles gallery, the Styles pane, the Apply Styles dialog box (Windows only), and keyboard shortcuts. I also offer tips for choosing the right style to apply.

Using styles to set spell-check options

How to use styles to set the language (English, Spanish, German, etc.) for different parts of a document.

Using styles to disable spellcheck

How to use styles to turn off spell checking altogether for some text in a document, with some discussion about when that's useful.

Creating inherited styles ("style based on")

All about using the "style based on" feature, which I refer to as inherited styles. This lets you define one style, and then easily create and change similar styles that are based on that basic style.

Using styles for lists, Part 1: auto-lists

Discusses how Word applies a style to list items when you use the toolbar buttons to create bulleted and numbered lists, and what you can and cannot change about that style.

Using styles for lists, Part 2: styling lists using paragraph styles

Discusses how you can use paragraph styles that have bullets or numbers to style different levels of lists.

Using styles for lists, Part 3: creating list styles

Shows you how to use a list style (aka a multi-level list style) to have complete and utter control over how to style lists.

Other Word features

Creating a keyboard shortcut to paste plain text

Although this is specifically about how to create a keyboard shortcut for pasting plain text, it's really a tutorial on how to create a keyboard shortcut for any Word command.

Backing up the Normal template automatically

Instructions on how to use scripting features in Windows to automatically back up the Normal.dotx file twice a day.

[categories]  

|


  09:54 AM

A fairly regular occurrence in the editor groups I participate in on Facebook or Twitter is that someone posts about how the spelling or grammar tools in Microsoft Word have gotten something spectacularly wrong. As I've noted before, editors in particular seem to take glee in bashing the grammar checker.

I find this frustrating for a couple of reasons, and I've pushed back a bit on social media when I see posts that dismiss proofing tools. But I thought I owed it to people to explain why I think it's not productive exercise to bash the tools. (Modulo the entertainment value of hilariously bad advice, which is by no means limited to advice dispensed by tools.)

I'm going to focus on two issues: the measurable deficiencies of the tool, and the question of audience.

Measureable, reproducible deficiencies

Imagine that you are a program manager (PM) at Microsoft whose job it is to improve the grammar-checking tool. It's not news to you that the tool gets things wrong sometimes.

You go out into the world to find out what sorts of problems people are having with the grammar checker. You find no shortage of complaints. An article in Slate claims that the grammar checker "makes your writing worse." At least that article has some explicit examples. Other complaints are more abstract:




Put yourself in the place of that PM. How is the grammar checker "creating problems"? Which things is it flagging that are "not errors"? What are examples of the "incorrect options as solutions"? These types of generalized, "it just doesn't work!" observations don't help the PM learn anything specific about what to fix. And they don't necessarily help other users, either, since it doesn't tell a user what to look out for.

As a PM, I might also have some questions about how prevalent these errors are. What percentage of the time does the grammar checker correctly flag errors? 15 percent of the time? 40 percent? 85 percent? In other words, are the issues that people report exceptions in an otherwise functioning tool, or are errors the norm? (If errors are the norm, I as PM would be surprised, since it's not like the company doesn't test the grammar checker.)

There's also a question about what constitutes an error. The grammar checker can find actual, non-controversial errors, like subject-verb disagreement. It can also check style—things like the use of passive:


As the PM, I might ask people to adjust the various knobs and levers to see whether the "mistakes" made by grammar checker are simply suggestions that they disagree with.

If I were that PM, I'd say that sure, please let us know where you're running into issues with the grammar checker. But be specific. Show us the error. Will we be able to reproduce it on the current version of Word? If you adjust the settings, do you still see the issue? And I would ask that in addition to posting on social media about the error, why not engage with the Microsoft community to see if your issue is known? In short, I as PM would ask you to use your experience to help make the product better.


Audience

Let's move on and talk about who the audience is for the grammar checker in Word. Let me posit this: the grammar-checker tool in Word is not designed for professional editors. No, let me take a step back: Word itself is designed for corporate use. When the Office team thinks about improving their product, they're not thinking primarily about freelance editors, or novelists, or programmers who are creating README files. They think a great deal about employees at companies that are going to buy 500 or 5000 or 50,000 site license of Office. Merge tools for mailing labels? Two-click tables of contents? Let's face it: the prototypical Word user is someone who sits in a cubicle.[1]

My point is that I think the prototypical user is not expert in spelling or grammar. Nor are they producing works of art— no, they're working on reports and memos and other contributions to the great stream of prose that moves corporations forward every day.

I note this because one editor I know said that she had once taken an article by Louis Menand (Harvard faculty, writer for the New Yorker) and run it through the Word grammar checker. She reports that the grammar checker had substantially worsened the article.

This does not surprise me. Let me give you an analogy. Suppose you want to make a dress. You buy a dress pattern and carefully follow all the directions. When you're done, you have a dress! But you do not have a Pierre Cardin dress, or a Dior, or a Vera Wang.

A dress pattern lets a person of modest skills produce a functional finished product. A dress pattern in the hands of an ordinary person does not produce a work of art. Similarly, the grammar checker in Word helps a writer of ordinary skills produce workable copy. It is not designed to help an ordinary writer produce extraordinary prose. It will not turn the average denizen of a corporate cuberhood into Louis Menand.

We professional editors cannot make broad judgments about a tool because we think it isn't as smart as we are about grammar and style. (Though it is probably more thorough.) We have to consider whether it's useful for its intended audience, and gauge the tool in terms of how well it helps that audience.

Finally, we have to help people use the tool to its best advantage. If someone who is unskilled is using some tool incorrectly, you don't say to them "Yeah, that tool sucks." You teach them how to use it right. How about if we do that?

Related posts:
[1] Full disclosure: this is speculation on my part. I am not privy to the planning process of the Office team, past or present.

[categories]  

|


  08:28 AM

There are many reasons to use styles in Word, as I've noted before. One feature I find handy is using styles that have different spell-check options for different types of text. I'll explain a couple of examples: one where I set a non-default spell-check option (Spanish), and another where I disable spell check for code snippets.

Note: If you'd rather see this on video, see the links below.

Spell check for non-default languages

Suppose you're writing a document that has quotations in different languages. If you run spell check over the document, it'll barf when it gets to your citations in Spanish or French or Latin or whatever.[1]

The hard way to solve this problem is to select the text of each citation, one by one, and then to set the proofing language (Review tab > Language > Set Proofing Language).

The easier way to do it is to define a style and set the language for that style. Then you can just apply the style to your citations.

Suppose I'm writing about One Hundred Years of Solitude by Gabriel Garcia-Marquez:


I run spell check, and uh-oh: if it's going to stop on every word of Spanish, it's going to be a long night proofing this doc:


Instead, I'll create a style just for my quotations in Spanish. In this case, I'll create a paragraph style, although I can set language options for character styles also, which is useful for cites in running text.

Here's the Create New Style dialog. The new style is named Quotation in Spanish. It's a paragraph style, based on Normal, and I've set an indent.


Then in the Format options (bottom left), I choose Language:


For the language, I choose Colombian Spanish:


Now I can apply this style to any citations in the document that are in Spanish. When spell check gets to the citations, it switches to checking spelling in Spanish. (Which is handy, since I'm a bad typist in multiple languages.)


If the document contains text in several languages, you create a different style for each non-default language that you're using and apply them as needed.

Disabling spell check for selected text

I don't actually encounter a lot of Spanish citations in my work, but I do encounter a lot of snippets of program code and HTML. I also encounter filenames and URLs that are oddly spelled per English conventions. As with non-English text, this can throw spell check off. So I create a style for code and for HTML blocks and for filenames and for URLs. In those styles, I disable spell check altogether.

Skipping ahead, here's an example of what some sample text looks like when these styles have been applied:


There are 3 styles at work here. The green monospace marks a character style named Code. The blue italics mark a character style named Filename. And the indented block with gray background marks text that's styled using a paragraph style named Pre (a nod to the HTML element name for code blocks).

In addition to the various formatting settings that I defined for these styles (italics, blue, green, monospace, indented, etc.), in each case I chose the Language setting. Then in the Language dialog, I chose Do not check spelling or grammar:


When spell check runs, it skips over any text that has been styled using a style with this setting.

I should note that for code and HTML snippets, it can instead make sense to add the various keywords to your dictionary. (I do this for filenames that I encounter often.) However, defining a style that simply turns off spell check has been very handy for me in the code- and HTML-heavy documents that I work on.

Videos

I made a couple of videos about this also and put them on YouTube:
[1] I do realize that Word can be set to auto-detect languages, and that this works pretty well. But the method I describe here also covers scenarios where auto-detect doesn't work well. (Klingon? Dothraki? Etc.)

[categories]   ,

|


  03:02 PM

As most people discover, there's a class of writing error that spell check just can't help you with. Consider these examples:
  • We recommend that the company shit its resources for better output.
  • The event is open to the pubic.
Run these through spell check, and all is well. Only, of course, it's not.

As I recently learned, Word has a feature that can help find errors like this: an exclusion list. An exclusion list has words that are spelled perfectly fine, but that should be excluded from your documents.

The steps for creating an exclusion list are described in a great blog post by Sam Hartburn. The basic idea is that you add words, one per line, to .lex files in a specific folder on your computer. Here's the Windows location--see notes later for Mac instructions:


You can use any text editor to edit the file, including Notepad.

Note that there are different .lex files for different languages, and in fact for different flavors of each language—e.g. English US and English GB. (It's not inconceivable that there's a way to set up a global .lex file, but I don't know. Leave a comment if you know about that.)

Once you've got your exclusion list(s) updated, close and then reopen Word. Then when you run the spell checker, Word will flag words that are part of your exclusion list:


The examples I've shown here pertain to, you know, taboo vocabulary. Another excellent use for this feature is to flag words that you often mistype but are technically spelled correctly, such as manger for manager or potion for portion. Or you can use it for terms that should be avoided in your particular work, even if they're perfectly cromulent words in English. Really, you can use the exclusion list feature to have Word bring to your attention any word that you might want to double-check as part of your proofing.[1]

I do have a couple of notes for you about using exclusion lists:
  • Words in the list are case sensitive. (As indeed they are in the Word spelling dictionaries.) For example, it's probably a good idea to include both assed and Assed.

  • It's up to you to include all variant forms of a term, including plurals and verb conjugations: ass, Ass, asses, Asses, assed, Assed, assing, Assing, etc.

  • With regard to having different .lex files for different language variants, it will up to you to know what languages are in use in a given document. If a document has been through many hands, it's possible that different sections or paragraphs or even words might be flagged as having different language settings.
I learned about all this from a Twitter thread and specifically from the editor Ashley Bischoff. Not only did she introduce a bunch of us to exclusion lists by pointing to the blog post, she took the initiative to create a Google Docs spreadsheet for collecting words for potential inclusion. The doc is open to anyone. Please contribute!

PS Ashley has a second sheet in the workbook with instructions for both Windows and Mac users on how to update your exclusion lists.


[1] Microsoft alums will recognize this as similar to the Policheck tool, about which I've written before.

[categories]   , ,

[2] |


  12:24 PM

I rassled a bit recently with a couple of dumb issues when creating some Word macros, so I thought I'd better write these up for my own future reference. To be clear, "dumb" here means that I should already have known this stuff, and I wasted time learning it.

1. Calling subroutines

I was trying to call a sub like this:
Sub SomeMacro
SomeOtherSub(p1, p2)
End Sub
Word got so mad about that SomeOtherSub call:


Turns out that when you call a subroutine in VBA and pass parameters, you do that without parentheses:
SomeOtherSub p1, p2
The parameters can be positional, as here, or named. For the latter, use the := syntax:
SomeOtherSub p1:="a value", p2:="another value" 

2. Exposing subroutines (implicit access modifiers)

Here was another kind of bonehead mistake I made. I wrote a subroutine sort of like this:
Sub MyMacro(param1 As String, param2 As String)
' Code here
End Sub
Then I tried to actually run this macro (Developer > Macros). The macro stubbornly refused to appear in the Macros dialog box. If I was in the macro editor and pressed F5 to try to launch it in the debugger, Word just displayed the Macros dialog box for me to pick which macro to run, but again, did not display the actual macro that I actually wanted to run.

Anyway, long story short (too late, haha), the problem was that the Sub definition included parameters:
Sub MyMacro(param1 As String, param2 As String)
Apparently if a subroutine has parameters like that, VBA considers it to have protected access—it can be called from another macro, but it can't be launched as a main. This makes sense, but it wasn't immediately obvious. What I really wanted was this:
Sub MyMacro()
I had included the parameters by accident (copy/paste error), so it was basically a dumb mistake. I just removed them and then things worked. Well, they worked until VBA ran into the next dumb mistake, whatever that was. (In my code there's always another one.)

[categories]   ,

|


  02:35 PM

Another quick post about Word, primarily for my own benefit (when I forget this later).

Word has several options for how you can paste text:


They are (in order):
  • Keep Source Formatting. This option keeps the original formatting (both character and paragraph formatting), but converts it to direct formatting.

  • Merge Formatting. This option copies basic character formatting (bold, italics, underline) as direct formatting, but does not copy any paragraph formatting.

  • Use Destination Styles. This option copies the text and applies styles that are in the target document. (This option appears only if there matching styles in the target doc.)

  • Keep Text Only. This option copies the text as plain text, with no formatting.
I need the last one (paste plain text) more often than any of the others, so I want it on a keyboard shortcut. You can do this by recording a macro of yourself using the Keep Text Only option. But I realized there's an even easier way—just assign a keyboard shortcut to the built-in PasteTextOnly command.

I keep forgetting that most anything Word can do has a command. If a gesture requires just one command, you can assign a keyboard shortcut directly to it. Maybe writing this out will help me remember.

Update I added a video!


[categories]   , ,

|


  12:01 AM

This is another in a series of blog posts about how I configure Microsoft Word, which I add here primarily for my own reference.

I often use the Style pane, and within that pane, I often want to change the styles that are displayed. Sometimes I want to see all the styles; sometimes just the styles that are defined in the current document; sometimes just the styles currently in use.

You can change this display by using a dialog box. In the Styles pane, click the Options link, and then use the dropdown lists to select which styles to display and how they're ordered, like this:


But that can get to be an annoying number of clicks if you're switching between these display options frequently. So, macros to the rescue. I recorded myself making one of these changes, then created a couple of variations to give me the different displays I want. Here are the macros I currently use, where the sub name is (I hope) self-explanatory:
Sub SetStylesPaneToAllAlphabetical()
ActiveDocument.FormattingShowFilter = wdShowFilterStylesAll
ActiveDocument.StyleSortMethod = wdStyleSortByName
End Sub

Sub SetStylesPaneToInCurrentDocument()
ActiveDocument.FormattingShowFilter = wdShowFilterStylesAvailable
ActiveDocument.StyleSortMethod = wdStyleSortByName
End Sub

Sub SetStylesPaneToInUse()
ActiveDocument.FormattingShowFilter = wdShowFilterStylesInUse
ActiveDocument.StyleSortMethod = wdStyleSortByName
End Sub
To complete the picture, I map the macros to these keyboard shortcuts:

ctrl+shift+p,aSetStylesPaneToAllAlphabetical
ctrl+shift+p,cSetStylesPaneToInCurrentDocument
ctrl+shift+p,uSetStylesPaneToInUse

[categories]   , ,

|


  12:23 AM

I have used Microsoft Word for years—decades—but hardly a week goes by when I don't learn something new. (Including things that are probably pretty well known to others, oh well.) Anyway, TIL about how to use the batch version of auto-formatting in Word. Since I think a lot of people already know this, I'm adding the information here primarily for later reference for myself.

Word has settings to perform "auto-formatting as you type." These include things like converting quotation marks into so-called smart quotes (i.e., typographical quotation marks), converting double hyphens (--) into em-dashes (—), converting typed fractions (1/2) into typographic fractions (½), etc. You set these options in the AutoCorrect dialog box: File > Options > Proofing, AutoCorrect Options button, AutoFormat As You Type tab.

It turns out that Word can also apply these auto-formatting instructions after the fact. In the same AutoCorrect dialog box, there's a tab named just AutoFormat:


This has most of the same options as with auto-format-as-you-type. Here's the neat part: you can get Word to apply these formatting options by pressing alt+ctrl+k. There's no UI gesture, but you can use the feature for customizing the ribbon to add the relevant command to the ribbon or Quick Access Toolbar.

A use case where I can see this working pretty well is if you paste text in from a text editor. (I do this all the time.)

Credit where it's due: I learned about this from the article How to Automatically Format an Existing Document in Word 2013 by Lori Kaufman on the How-To Geek site. As I say, I'm adding this info here primarily for my own benefit. :-)

[categories]   , ,

|