About

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

Read more ...

Blog Search


(Supports AND)

Google Ads

Feed

Subscribe to the RSS feed for this blog.

See this post for info on full versus truncated feeds.

Quote

I just tricked my son into eating a corn dog by calling it a lollipop. Parenting is essentially just a series of lateral thinking puzzles.

Matthew Baldwin



Navigation





<September 2020>
SMTWTFS
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

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  

Contact Me

Email me

Blog Statistics

Dates
First entry - 6/27/2003
Most recent entry - 7/27/2020

Totals
Posts - 2626
Comments - 2635
Hits - 2,301,215

Averages
Entries/day - 0.42
Comments/entry - 1.00
Hits/day - 366

Updated every 30 minutes. Last: 6:18 AM Pacific


  08:15 PM

I spend a lot of time on social media—Facebook, Twitter, and Instagram. There's value here; for example, I "know" many people only through these media, and I much appreciate what I've learned from them. For example, I know hardly any linguists IRL, but I follow many on Twitter, and it's great.

But even I can tell that I overdo it. It's a time suck, and it's an easy way to procrastinate when I need to be doing, you know, work. ("While this documentation is building, I'll just check Twitter quick-like.")

More insidiously, too much social media starts making me cranky. And when I get cranky, I do unfortunate things, like respond in pissy ways to innocent posts by other, nicer people. Or, gah, I give in to the temptation to respond to morons and their idiotic political opinions, a no-win situation if ever there was one.

So I decided recently to implement what I'm calling Asocial Sundays. Between midnight on Saturday night and midnight on Sunday night, I don't visit any social media sites, period.

This is a new experiment, but I can see some benefits already. Not having the option of social media redirects my attention to more productive things. If I'm sitting at my desk and finish some task—paying bills, say—I don't just mindlessly switch to FB or Twitter to see what's up. Instead, I might actually get up from my desk and wander into the rest of the apartment.

It also has been a way to unplug from a source of stress. We all know that it is distinctly not conducive to good sleep to doomscroll Twitter before bed. Politics and COVID are inescapable on social media, and both are not only inherently stressful, they're sources of endless arguments, outrage, scolding, shaming, uninformed opinions, and on and on. It's nice to take a break from that.

I'm far from ready to withdraw altogether from social media, the way some of my friends have. (A social media detox or social media fast, as it's sometimes called.) I've occasionally considered unplugging permanently from Facebook because their ad models are scary and because Zuckerberg is an incorrigible weasel. But as I say, I still get a lot from my social interactions.

If the experiment goes well, I might at least expand my lights-out policy for social media. I suspect that the more I do it, the easier it will be to use social media in a healthier way.

[categories]   ,

|


  10:42 AM

One of the effects of this year's protests is that it has brought about heightened consciousness about language and how it affects or reflects certain thinking. For example, there have been discussions in the editorial community about capitalizing the word Black "in a racial, ethnic or cultural sense."

In the world of IT, we've been discussing the implications of certain terms for a while. The Microsoft style guide has suggested for a over a decade that writers avoid the terms whitelist and blacklist in order to avoid a connotation that white==good and black==bad. (I wrote about this a while back.)

Our own style guide has a section on inclusive language, and it suggests finding alternatives to a range of language that, when you look at it consciously, can have negative connotations or the possibility of offense. In addition to disrecommending the word blacklist, we tell our authors to use alternatives to terms like crippled system, dummy variables, sanity checks, native features, and first-class citizen.

A short digression about cloud technology. (For tl;dr, you can skip to the discussion of terminology.) We work in the world of cloud computing, which has its own concepts and vocabulary. The cloud, as the jokey definition goes, is just using someone else's computer. More specifically, it means using someone else's one or ten or hundreds of computers, because a fundamental benefit of the cloud is that you can adjust computing power as needed. For example, if you have a retail business, your website might need medium power normally, low power during a summer slump, and heavy-duty computing power to handle your yearly sale. The point is that your need for computing resources goes up and down, and rather than having to build out your own data center to accommodate the maximum possible demand (and whose high capacity might mostly just sit idle), you build your system in the cloud and spin up computers (servers) when demand is high, and take them down when they're no longer needed.

In this environment, computers are commodities. Any single computer is just a faceless worker in your overall computing infrastructure. Compare that to the computer sitting on your desk; you've probably personalized how it runs, installed many updates, and otherwise fussed over it. If one of the faceless computers in the cloud crashes, it's not a big deal; another one spins up and carries on the work. On the other hand, if your personal computer crashes, it's usually a disaster.

Ok, back to terminology. To conceptualize the difference between the faceless fleet of computers in the cloud and your personal computer, technologists devised the metaphor "cattle, not pets."[1] If a computer is a quasi-anonymous something that can be replaced any time, it's "cattle"; if it's an indispensable part of your work, it's a "pet."

Some authors love this metaphor, because, undeniably, it has explanatory power. More than once it's appeared in a document I'm editing, and if I question it, I'll be pointed to how widespread the expression is in IT/cloud texts. And we try to use the vocabulary of our audience.

However. One of my colleagues recently pointed out what might be obvious to a lot of people: the expression "cattle, not pets" is … problematic. One of our principles is "avoid unnecessarily violent language," and once you think about it, you realize that there's implicit violence in the metaphor as pertains to the fate of the "cattle." Moreover, there are cultures in which no cow is just "cattle," and for whom the idea of animals being killed is abhorrent. Therefore, we've updated our guidance to "avoid the use of figurative language that relates to the slaughter of animals."

This sets up a tension we sometimes have when we tell writers to avoid terminology that's still common in a field. We might ask authors to avoid whitelist or cattle-not-pets, and they'll point out that these are well-understood expressions and that using some alternative form potentially confuses readers. ("Allowlist? Did you mean whitelist? Why not just say so?") And people might search for these terms and they'll have no joy if they don't appear in our documentation. Plus it can give off the vibe that we don't know our own field.

But change begins at home. Sure, these problematic terms are part of the industry lingo. And we can't just ignore them out of existence. What we often do, then, is to include the expression parenthetically on first mention of the preferred term. So we might suggest something like "Create an allowlist (whitelist)" or "servers as commodities (sometimes referred to as 'cattle, not pets')" to tie the old term in the reader's mind to a new, better one.

We hope that the collective work of consciousness-raising by many editors and writers over a period of time will gradually alter the perception of problematic terms. The work is never truly done, of course, but it has to start somewhere.

PS I should note that not everyone supports the idea of this type of language change; there's plenty of pushback in the IT world against changing to "so-called inclusive language." These things are not easy.

[1] Devised to explain scaling by Bill Baker, adapted for the cloud by Randy Bias.

[categories]   , ,

|


  08:25 AM

We've been without a microwave oven for about 9 months now.

This is not because we have some sort of philosophical objection to microwaves; the reason is much more practical. Before we remodeled the condo, there was a built-in microwave above the stove, which doubled as the no-vent/recirculating range hood. We knew that we didn't want this 1980s-era microwave, and we replaced it with a dedicated range hood:

Our initial idea was that we would get a countertop microwave. But once we'd moved in and sorted out the kitchen, there wasn't really an obvious place to put a microwave, because there's just limited counter space, alas.

So we've been doing without. This means we've had to explore substitutes for how we used to use the microwave. Like, how do you reheat leftovers without a microwave?

We use our oven or toaster oven. The room we might have given over to a microwave is taken up by a small toaster oven. That appliance is more useful than a microwave, I think, because it can heat and toast and broil. I make toast all the time, and we have no toaster-toaster, so this is a daily-use device for me.

One of the advantages of a microwave is that it's fast. But heating things in our little toaster oven doesn't take that much longer. It's a little oven, so it heats up pretty fast. It also has a convection setting (which I think just means it has a fan that blows the hot air around). All in all, what might have taken, say, 2 minutes in the microwave takes maybe 8 or 10 minutes in the little oven.

We heat things on the stovetop. Anything that's got liquid—soup, stew, whatever—we can throw in a pot and heat on the stovetop.

There are definitely dishes that would be easier to reheat in a microwave. Leftover pasta, for example. What I've been doing is putting these into a pan on the stovetop with a glug of water and a lid. It's not perfect, since it inevitably steams whatever you're reheating, but it's tolerable.

We (mostly I) heat things in a frying pan. Some dishes can be fried or refried. Heat a splash of oil in a frying pan and toss in your leftovers. If I fried up hash yesterday and have leftovers (unlikely), I can reheat it by giving it a short version of the same treatment again. And if we've got something like leftover rice, I can steam it again, or I can make fried rice.

I never much liked defrosting things in the microwave anyway. These days, if I have to defrost a hunk of hamburger, for example, I'll put it in the Dutch oven on very low heat on the stovetop.

And then there's popcorn. I love me my popcorn, but I never used prepackaged microwave popcorn anyway. I did have a series of microwave poppers, but they have an unfortunate tendency to break. So I went to the discount store and got a cheap 6-quart pan that is my dedicated popcorn popper. I heat it on the stove and do that classic thing where you shake the pan as the popcorn pops merrily.

I don't miss the microwave as much as I thought I would. It's been interesting to, in effect, return to our pre-microwave days. I didn't grow up with a microwave (back when they were known as "radar ranges," ha), and it wasn't ingrained in me to rely on it. We might still get one someday, but I think that the longer we make do without it, the less likely it is that we'll want to house one more bulky appliance in our limited kitchen space.

[categories]   , ,

|


  07:00 PM

I commute to work on crowded mass transit, and when I get there, I work in an open office. So I consider good headphones an essential part of my gear. My employer apparently agrees; they subsidize headphones for us. I’ve appreciated the pair I got: over-ear, noise-reducing, Bluetooth headphones. I use them for hours a day every workday.

But the daily use has taken a toll. A few months ago I noticed that the headphones seemed loose on my head. Close examination revealed that the plastic arch between the earpieces had cracked. Thus began an ever more involved effort to save these lovely headphones.

Bridging the crack

My first thought was to patch over the crack. I found a washer that was about the size of a quarter, and used epoxy to glue the washer across the crack, then taped it over to salvage some semblance of aesthetics. (Ha.) was a little dubious about this, but it actually worked ok.

However, a few weeks later the headphones were loose again. I thought my patch had failed, but no—a second crack had appeared at a different point. It seemed clear that there are stress points in the headphones:

I tried a second patch like the first one, but a third crack developed.

Repair or replace?

After this discouraging development, I spent some hours online looking for a replacement for my headphones. I looked and looked, but two things ultimately stopped me from buying a new pair. One was that omg, headphones that have all the features I want (NR, Bluetooth, over-ear, decent audio) are expensive. And to add to this disheartening discovery, many reviews suggested that many other brands of headphones were probably just as prone to breakage as the ones I already had. So I returned to the idea of trying to engineer a fix for the ones I already had.

Brothers of bands

After the severally patched cracks had failed, I kept thinking that I needed to in effect make a new arch for the headphones. I needed some sort of spring-like band of material that I could attach to the headphones. (Some people might already have thought about an obvious solution, which I arrived at later; bear with me a few moments.) I kept thinking about some sort of plastic, but couldn’t arrive at a material that was both flexible enough and had enough spring. What I eventually did was to cut apart the plastic jar from a well-known brand of popcorn and laminating four layers. This seemed to provide the right amount of spring:

I then taped this ad-hoc spring to the headphones with lots of tape, even further reducing their visual appeal:

(I swear that I catch people on the train looking at my jury-rigged headphones and wondering “What the heck is that?”)

Is there a spring for the head?

This worked pretty well for a couple of months. But inevitably, my plastic spring started losing some of its sproing, so I was back to thinking about a better way to make this fix. It finally occurred to me that there is a device that is pretty much designed for this exact purpose: headbands for hair. I betook myself to the beauty section of the local drugstore and pondered my many choices. I ended up with a set of thin metal bands:

I disassembled and reassembled the headphones, this time adding one of the metal headbands to the arch. (I don’t want them to be too springy, because I wear the headphones for long periods and don’t want to squash my ears.)

And that’s where I am today. I’m hoping that this repair, or if necessary, another one like it, will hold until the electronics fail, or I step on them accidentally, or I have some other reason to buy a new pair. And next time I’ll have a head start on ways to fix the headphones when they start cracking.

[categories]   , ,

|


  09:30 PM

I find it harder and harder these days to ride as a passenger when other people drive. Some of that is just part of getting old. But it's not just that; as I've noted before, learning to ride a motorcycle has helped make me a better driver.

One tactic I've worked on is how much space I leave between me and the driver in front of me. To my mind, most people follow too close. You really don't want to do that. Here's why.

Note: If you want the tl;dr, skip to So what do I do?

Speed and distance

Let's start by examining what sort of distance you're covering when you drive, because it might be more than you think. At 10 mph, in 1 second you cover about 15 feet. At 70 mph, in that same 1 second you cover 103 feet. Here's a graphic that illustrates this ratio.

An accepted measure of a car length is 10 feet. This means that if you're going 60 mph, in 1 second you will travel 9 car lengths. Even small differences in speed result in significant differences in how far you travel—the difference between driving at 60 and at 70 is that in 1 second at 70 you will travel an additional 15 feet (88 vs 103). More than one car length.

Braking distance

Let's imagine that for some reason you have to slam on the brakes. Alas, physics tells us that you cannot stop on the proverbial dime. The faster you're going, the longer it takes to get to zero mph.

There's no standard chart for stopping distance for cars. Cars weigh different amounts and they have different brakes; for example, newer cars have anti-lock brakes a.k.a. ABS. (Jeremy Clarkson of the TV show "Top Gear" also makes the case [video] that cars that are engineered to go fast are also engineered to stop quickly.) External factors also come into play, such as the road surface (wet? gravelly?) and the tires on the car. Also whether you're going uphill or downhill.

Anyway, it's complex. The best that people can offer is a minimum braking distance based on a formula that takes into account the initial speed, the car's mass (weight), and the friction coefficient of brakes and road. I'll spare you that here, but I'll suggest some ballpark numbers, as shown in the chart. (You'll see a variety of numbers for this measure if you look around; these are actually on the low end.)

Notice that braking distance at 60 is 180 feet—18 car lengths. That's about 1 city block. Going 70, which of course is only 10 mph faster, the braking distance goes up to almost 250 feet, or an additional 7 car lengths.[1]

Reaction ("thinking") distance

Braking distance is measured from the time the brakes are engaged. But everyone will remind you that there's a delay between the time you see that you have to brake and when you finally get your foot onto the pedal. Remember from the earlier bit that if you delay one second before you hit the brakes, your car might already have traveled many car lengths before you even start slowing down.

The combination of reaction distance and braking distance is referred to as the total stopping distance. Since I'm all about the pretty charts today, here's one from the UK that shows the total stopping distance as "thinking distance" plus braking distance (click to embiggen):

It's the total stopping distance that matters when you're driving behind someone: how far will you keep going before you can stop if something happens ahead of you? Or stated another way, is there enough room between you and the car ahead so that if they slammed on their brakes, you could avoid slamming into them?

As with braking distance, there's no standard measurement for reaction distance. Some people have faster reflexes than others. But even lightning-quick reflexes result in some delay between stimulus and reaction.

And much more importantly, some people pay closer attention to traffic than others. People text while they drive, they yack with their passengers, they watch their GPS, they fool with their radio, they search the passenger footwell for their dropped phone, they watch TV while driving. There have been accidents where the driver behind never hit the brakes at all. In our little car bubble, we sometimes forget that we're piloting 1 ton or more of iron at 88 feet per second, something that's not scary only because we're used to doing it.

And it's your fault

The law generally puts the responsibility on you to leave enough distance. If you rear-end someone, it will almost be always considered your fault. There are a few circumstances when you can make a case that the driver in front contributed to the accident, but the default assumption will be that you were not driving in a safe manner. Not to mention, I suppose, that if you have an accident, you will have had an accident, with all the hassle that that entails.

Think of the traffic

Even if you have superhuman reflexes and a physics-defying vehicle that can stop on a dime, leaving a gap between you and the car in front can have benefits for overall traffic flow. By leaving a gap, you can actually minimize the accelerate-then-brake cycle that characterizes most heavy traffic.

Imagine that you’re behind someone and they tap their brakes to slow down by 5 mph. If you’re close, then you, too, have to tap your brakes to slow down. Even this small slowdown, and even if both of you immediately speed up again, creates a kind of wave that moves backward through traffic. In fact, this is sometimes the source of “phantom” slowdowns on the freeway, where everyone slows down for no apparent reason.

However, if you’re far enough behind someone, when they tap their brakes, you might not need to tap yours at all, or you can slow down enough just by easing off the accelerator. And if you don’t have to, the person behind you doesn’t either, and so on backwards through traffic. Result: possible traffic jam averted.

The engineer William Beatty refers to this as "eating" traffic waves. He explains:

By driving at the average speed of traffic, my car had been "eating" the traffic waves. Everyone ahead of me was caught in the stop/go cycle, while everyone behind me was forced to go at a nice smooth 35MPH or so. My single tiny car had erased miles and miles of stop-and-go traffic. Just one single "lubricant atom" had a profound effect on the turbulent particle flow within miles of "tube."
Obviously, there are limitations to this; if traffic is completely stopped, it’s just completely stopped. But if you can help reduce traffic jams by leaving a little extra space between you and the next person, isn’t that a worthy goal?

So what do I do?

When I got my license many decades ago, the rule was to leave 1 car length ahead of you for every 10 mph. If you're going 60 mph, 6 car lengths. As you can see from the various distances listed above, that's probably not enough. And that's even assuming that you can estimate car lengths correctly, which I think a lot of (most?) people cannot. (Little-known fact: the dashed white lines between lanes on the freeway are 10 feet long.)

When I got my motorcycle license, I learned a far more useful guideline: the three-second rule (PDF). The idea is that when the car ahead of you passes some landmark (a streetlight, a sign, anything static), you count "one-thousand-one, one-thousand-two, one-thousand-three." If you reach the landmark before you finish counting, you're following too close.

The rule is useful because it's independent of speed—the faster you're going, the longer the distance is that you go in 3 seconds, so it (kind of) works out. Naturally, this is just a rule of thumb, which has to take into account all the factors that go into how quickly you can stop. But it has the advantage that if you routinely practice counting off your 3 seconds as you drive on the highway, it means you're paying attention, and that's a very big factor in how safely you're driving.

Event horizon

As if it isn't hard enough just to pay attention to the car in front of, you really should be aware of what's going on in front of them. The same motorcycle manual that recommends the three-second rule suggests that you try to see what's happening 12 seconds ahead of you. This is sound advice, because the driver in front of you might not be paying close attention. If you see that the driver ahead will have to slow down even before they're aware of it, you can adjust your own driving accordingly. (This is captured in the concept of assured clear distance ahead, which you can read about in a particularly poorly written Wikipedia article.)

By the way, all of this applies also to cars behind you, and to your side. Driving safely is hard work.

If you can't see ahead of the car in front of you, it's best to leave even more room than you normally would. I actually have this problem a lot. The motorcycle isn’t very tall, of course. And my normal car is a MINI, which sits pretty low to the ground. In both cases, if I'm behind an SUV or pickup or anything larger than that, I have no clue what's going on up front.

Parting notes

People have pointed out that if you leave gaps ahead of you, other drivers will swoop in. That's true. If you have completely mastered the zen of good following practice, you just let them, and you slow down to again open up a suitable gap ahead of you. I will acknowledge that this is a state of driving enlightenment that most of us can only aspire to. Still, it has helped me to think holistically about safety and about traffic, and if I’m in just the right frame of mind (like, not late to an appointment), I can do a decent impression of someone who actually has mastered all this. And of course, if I'm on the motorcycle, I am ever mindful that even a small miscalculation in how closely I follow can have grave consequences.

For the most part, driving is uneventful. Even if we speed, even if we speed and follow too closely, mostly things don't happen. But it's this very uneventfulness that can make us complacent and lead us to stop paying close enough attention to an activity that can wreak mayhem in the "unlikely event of" a crash.[2]

[1] I'm not sure how clear this is, but the "safety" of a large vehicle like an SUV has to do with how well it survives a crash, not in how well it can avoid one by, for example, stopping quickly.

[2] There's a movement to stop using the word "accident" and instead use the word "crash" in order to emphasize that almost all crashes are caused by drivers. The Motorcycle Safety Foundation puts it this way: "Using the word accident tends to make people think safety is a matter of luck, and it isn't."

[categories]   , ,

[2] |


  02:36 PM

Here's a keen thing I learned about from a Vox article: a Chrome extension named Library Extension that adds library information when you're viewing books on Amazon or Goodreads. The extension tells you whether the book you're interested in is available in one or more library systems.

Let's say you're interested in the book The ABC of How We Learn, so you look it up on Amazon. In the bar at the top of the page, the library extension icon lights up to tell you that you're on an enabled site:


On the actual page where you're viewing book information, the extension displays library information:


If you want to get the book from the library, you click the Borrow button. This sends you to the library site with the book preloaded.

To configure the extension—for example, to tell it which libraries you want to look in—you click the icon in the toolbar, then click Options:


In the options dialog, you find the library you're interested in, then click the add (+) button:


I just started using this, so I don't know whether I'll end up liking it. It seems a bit intrusive to actually inject information into the page, instead of optionally displaying that information in a dialog or something. I also don't know how robust it is. Does the extension rely on Amazon APIs? Does it scrape information from the page? (A strategy known to be fragile.) How reliable will it be in terms of interacting with library sites?

But I like the concept just fine, since it reflects something I do a lot anyway—namely, look up books, then see if I can get them at the library. I'm curious whether others use this extension, or something like it, and what they think.

[categories]   , ,

[1] |


  09:11 PM

Not long ago I posted something about saving your hearing via the diligent use of earplugs if you are around loud things. (In my case, a motorcycle.) I didn't note then that my problem with being able to hear clearly is not new. I've had trouble for a long time hearing conversation in loud restaurants or understanding dialog in movies.

In fact, I had my hearing tested a while ago. Paradoxically, the results said that my hearing is great in some sort of Platonic sense, as in, when tested in ideal conditions in a lab. But Dr. Ears admitted that there was nothing to be done about my filtering problem—being able to pick out from background noise the sounds I actually wanted to hear.

Hearing aids are an option, I suppose. But good hearing aids are shockingly expensive, and often are not covered by insurance. And it's not at all clear to me that they solve this specific problem of attenuating the background noise specifically.

Well, in the creepy way of modern internet advertising, which can apparently read your mind, I recently started seeing ads for something pretty new: "conversation-enhancing headphones." For example, Bose has a product that they call Hearphones. Doppler Labs (which is suing Bose over all this) has a product they call Here Active Listening headphones. (Here, hear, get it?)

If I understand correctly, the devices combine noise cancellation with directional microphones with a kind of equalizer app (on your phone) to do pretty much what I need, namely tune and/or filter noise versus signal. And all at a price that is significantly less than hearing aids (Bose: $600, Doppler: $300). It's true, of course, that you're wearing headphones versus the invisibility of hearing aids. Then again, wearing headphones is pretty normal in a lot of contexts.

I'm pretty excited by all this. In fact, I'd probably go ahead and get a pair of these, but I've been around technology long enough to know that it's not usually a good idea to get version 1 of anything. By the time v3 of these things is available, they should be pretty great, right?

Let me add a linguistic note here as well. The name that Bose has come up with—hearphones—strikes me as so perfect for this device that it feels like it could easily become the genericized term for this class of thing. Any bets?

[categories]   ,

[1] |


  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]   , ,

|