Ready, Set, No-Go

You were supposed to leave work 15 minutes ago but you squeezed in some last minute details and now you want to run. So, you save & close your applications, and then click shutdown on your fancy new laptop with Windows 7. You jump up and get ready to run, but then you see the dreadful message:
Do not unplug your machine
Installing update 1 of 15 ….
Now what? You sit and wait 20 minutes while it installs, looking at your watch every minute. Isn’t there some way around this? 
Actually there is. Instead of using the Shutdown from the start button, do this:
  1. Type Control-Alt-Delete
  2. In the bottom right corner then is a small power button. Click the arrow
  3. Choose Shutdown
The menu that opens gives you the option to Shutdown with Updates or just Shutdown.
[Source: MyTechGuide]

The Path

Here is a handy shortcut that I just found out about:

Under Windows 7, if you need to copy the path to a file, you just hold the Shift key, then right mouse click on the file. The menu that opens now has a new menu item in the middle called “Copy as path”. You can then use Paste to put the full path where ever you like.

What is a Lexophile?

1. lexophile – A lover of cryptic words

For those of you who like punny lists:

1. A bicycle can’t stand alone; it is two tired.
2. A will is a dead giveaway.
3. Time flies like an arrow; fruit flies like a banana.
4. A backward poet writes inverse.
5. In a democracy it’s your vote that counts; in feudalism, it’s your Count that votes.
6. A chicken crossing the road: poultry in motion.
7. If you don’t pay your exorcist you can get repossessed.
8. With her marriage she got a new name and a dress.
9. Show me a piano falling down a mine shaft and I’ll show you A-flat miner.
10. When a clock is hungry it goes back four seconds.

11. The guy who fell onto an upholstery machine was fully recovered.
12. A grenade fell onto a kitchen floor in France resulted in Linoleum Blownapart.
13. You are stuck with your debt if you can’t budge it.
14. Local Area Network in Australia : The LAN down under.
15. He broke into song because he couldn’t find the key.
16. A calendar’s days are numbered.
17. A lot of money is tainted: ‘Taint yours, and ‘taint mine.
18. A boiled egg is hard to beat.
19. He had a photographic memory which was never developed.
20. A plateau is a high form of flattery.
21. The short fortuneteller who escaped from prison: a small medium at large.
22. Those who get too big for their britches will be exposed in the end.
23. When you’ve seen one shopping center you’ve seen a mall.
24. If you jump off a Paris bridge, you are in Seine.
25. When she saw her first strands of gray hair, she thought she’d dye.
26. Bakers trade bread recipes on a knead to know basis.
27. Santa’s helpers are subordinate clauses.
28. Acupuncture: a jab well done.
29. Marathon runners with bad shoes suffer the agony of de feet.
30. The roundest knight at king Arthur’s round table was Sir Cumference. He acquired his size from too much pi.
31. I thought I saw an eye doctor on an Alaskan island, but it turned out to be an optical Aleutian.
32. She was only a whisky maker, but he loved her still.
33. A rubber band pistol was confiscated from algebra class because it was a weapon of math disruption.
34. The butcher backed into the meat grinder and got a little behind in his work.
35. No matter how much you push the envelope, it’ll still be stationery.
36. A dog gave birth to puppies near the road and was cited for littering.
37. Two silk worms had a race. They ended up in a tie.
38. A hole has been found in the nudist camp wall. The police are looking into it.
39. Atheism is a non-prophet organization.
40. Two hats were hanging on a hat rack in the hallway. One hat said to the other, ‘You stay here, I’ll go on a head.’
41. I wondered why the baseball kept getting bigger. Then it hit me.
42. A sign on the lawn at a drug rehab center said: ‘Keep off the Grass.’
43. A small boy swallowed some coins and was taken to a hospital. When his grandmother telephoned to ask how he was, a nurse said, ‘No change yet.’
44. The soldier who survived mustard gas and pepper spray is now a seasoned veteran.
45. When cannibals ate a missionary, they got a taste of religion.
46. Don’t join dangerous cults: Practice safe sects.

Empty Nest(ed) Tables

I had a large document with many, many tables.  I needed to make sure that none of the tables contained any sub-tables.  Macros to the rescue!


Sub removeNestedTables()

‘ removeNestedTables Macro


    Dim myTable As Table
    Dim subTable As Table
   
    Dim ttCell As Word.Cell
   
    For Each myTable In ActiveDocument.Tables
        For Each ttCell In myTable.Range.Cells
            If ttCell.Tables.Count > 0 Then
                For Each subTable In ttCell.Tables
                    subTable.ConvertToText Separator:=”, “
                Next subTable
            End If
        Next ttCell
    Next myTable
End Sub

The Incredible Shrinking Sentence

The Cannonball Run (1981)
He’s my shrink. He was committed yesterday. 

If you have a block of code with long lines that you quote in a document, the long lines can wrap around to the next line which looks really bad and makes the code harder to understand.  To fix this problem, we start with a macro found over at WordTips and add a conditional statement so that it only is executed for a certain style (in this case Code Box). The macro reduces the font by ChangeSize and then checks if the paragraph fits on one line. It then repeats this process until it fits on one line.

Sub forceParaOneLine()
    Dim objPara As Paragraph
    Const ChangeSize = 0.5
   
    For Each objPara In ActiveDocument.Paragraphs
        If objPara.Style = ActiveDocument.Styles(“Code Box”) Then
            With objPara.Range
                While .Information(
wdFirstCharacterLineNumber) .Characters(Len(.Text)).Information(wdFirstCharacterLineNumber)
                    .Font.Size = .Font.Size – ChangeSize
                Wend
            End With
        End If
    Next objPara
               
End Sub
Note that if you have really long lines, this will reduce the font so that it is impossible to read.  To avoid this, I suggest using 2 styles in your document: one for code that can be shrunk, and one that is not shrunk.

Gmail: Going Label Crazy

Marion: [laughs] What is this stuff, Rene?
Belloq: [laughing as well] I grew up on this. It’s my family label.  
This morning I noticed that you can apply custom colors to labels in Gmail. I have used labels in the past, but the labels didn’t really stand out which reduced their usefulness.  With custom labels you can easily differentiate all the emails in your Inbox (work emails in one color, mailing list emails in another color, etc.)
Here’s how to use the custom colors. First, create labels and filers.
  1. Create a label. See instructions from Google Help.
  2. Create a filter to apply the label. See instructions from Google Help.

Now we need to apply custom colors to the labels. Click the little arrow next to the label that you want to change:

 When you click the arrow, you get a popup window like this one:
The color choices were a little too dark for my taste.  When I tried them, it was hard to see the text next to them because of the contrast.  You can click on Add custom color and choose a background and text color.
Now all your labels look just the way that you want them.
Happy labeling 🙂

Selecting a Text Block

I just came across the shortcut of the year for MS Word over at TechRepublic.  Normally, when selecting text, you select it in a continuous line.  You can expand the selection forwards or backwards.
But, did you know that you can select a text block?  This is one of the powerful features of Vim for those of you who have used Unix computers.
Just hold the ALT key while you click.

For example, if I have the following text:

REM First  line
REM Second line

REM Third  line

You can hold the ALT key and then select the first three letters of each sentence:
REM First  line
REM Second line

REM Third  line

You can also cut and paste a block of text. In the above example, one could cut the selection and then paste it in the middle of the first line, resulting in:

 First REM line
 SecondREM line

 Third REM line

Note that selection of text blocks does not work inside of tables.

[Source TechRepublic]

Word: TOC Switches

The Princess Bride (1987)
You only think I guessed wrong! That’s what’s so funny! I switched glasses when your back was turned! Ha ha! You fool! You fell victim to one of the classic blunders – The most famous of which is “never get involved in a land war in Asia” – but only slightly less well-known is this: “Never go against a Sicilian when death is on the line”! Ha ha ha ha ha ha ha! Ha ha ha ha ha ha ha! Ha ha ha… 

Switches are what you use when building a TOC in Word to make it do what you want it to do. For example, { TOC \c “tables” } will make a TOC based on a sequence field identifier.

Here are some basic field command shortcuts:
  • ALT+F9 show/hide all field codes
  • Shift+F9 show/hide current field code
  • Ctrl+F9 insert an empty field
  • Ctrl+a, then F9 updates all fields in the document
The following lists all the available switches (taken from the Microsoft site, see links at the bottom).

\c “SEQIdentifier”

Lists figures, tables, charts, or other items that are numbered by a SEQ (Sequence) field. Word uses SEQ fields to number items captioned with the Caption command (Insert menu, Reference submenu). SEQIdentifier, which corresponds to the caption label, must match the identifier in the SEQ field. For example, { TOC \c “tables” } lists all numbered tables.
\h Hyperlinks Inserts TOC entries as hyperlinks (hyperlink: Colored and underlined text or a graphic that you click to go to a file, a location in a file, a Web page on the World Wide Web, or a Web page on an intranet. Hyperlinks can also go to newsgroups and to Gopher, Telnet, and FTP sites).

\a Identifier Lists items captioned with the Caption command (Insert menu, Reference submenu) but omits caption labels and numbers. The identifier corresponds to the caption label. For example, although a caption on page 12 is “Figure 8: Mercury”, the field { TOC \a figures } displays entries as “Mercury…………12”.Use the \c switch to build a table of captions with labels and numbers.
\b BookmarkName Collects entries only from the portion of the document marked by the specified bookmark (bookmark: A location or selection of text in a file that you name for reference purposes. Bookmarks identify a location within your file that you can later refer or link to.).
\f EntryIdentifier Builds a table from TC fields. If EntryIdentifier is specified, the table is built only from TC fields with the same identifier (typically a letter). For example, { TOC \f t } builds a table of contents from TC fields such as { TC “Entry Text” \f t }.
\l Levels Builds a table of contents from TC fields that assign entries to one of the specified levels. For example, { TOC \l 1-4 } builds a table of contents from TC fields that assign entries to levels 1-4. TC fields that assign entries to lower levels are skipped.
\n Levels Omits page numbers from the table of contents. Page numbers are omitted from all levels unless a range of entry levels is specified. For example, { TOC \n 3-4 } omits page numbers from levels 3 and 4. Delete this switch to include page numbers.
\o “Headings” Builds a table of contents from paragraphs formatted with built-in heading styles (heading style: Formatting applied to a heading. Microsoft Word has nine different built-in styles: Heading 1 through Heading 9.). For example, { TOC \o “1-3” } lists only headings formatted with the styles Heading 1 through Heading 3. If no heading range is specified, all heading levels used in the document are listed. Enclose the range numbers in quotation marks.
\p “Separators” Specifies the characters that separate an entry and its page number. For example, the field { TOC \p “—” }, with an em dash, displays a result such as “Selecting Text—53.” The default is a tab with leader dots. You can use up to five characters, which must be enclosed in quotation marks.
\s Identifier Includes a number such as a chapter number before the page number. The chapter or other item must be numbered with a SEQ field. Identifier must match the identifier in the SEQ field. For example, if you insert { SEQ chapter } before each chapter heading, { TOC \o “1-3” \s chapter } displays page numbers as 2-14, where “2” is the chapter number.
\d “Separator” When used with the \s switch, specifies the number of characters that separate the sequence numbers and page numbers. Enclose the characters in quotation marks. Word uses a hyphen (-) if no \d switch is specified. In the table of contents generated by { TOC \o “1-3” \s chapter \d “:” }, a colon (:) separates chapter numbers and page numbers — for example, “2:14.”
\t “Style,Level, Style,Level,…” Builds a table of contents from paragraphs formatted with styles other than the built-in heading styles. For example, { TOC \t “chaptertitle,1, chapterhead,2” } builds a table of contents from paragraphs formatted with the styles “chaptertitle” and “chapterhead.” The number after each style name indicates the table of contents entry level that corresponds to that style. You can use both the \o switch and the \t switch to build a table of contents from built-in heading styles and other styles.
\u Builds a table of contents by using the applied paragraph outline level (outline level: Paragraph formatting you can use to assign a hierarchical level (Level 1 through Level 9) to paragraphs in your document. For example, after you assign outline levels, you can work with the document in outline view or in the Document Map.).
\w Preserves tab entries within table entries.
\x Preserves newline characters within table entries.
\z Hides tab leader and page numbers in Web layout view (Web Layout view: A view of a document as it will appear in a Web browser. For example, the document appears as one long page (without page breaks) and text and tables wrap to fit in the window.)
Links to Mircosoft info on fields can be found here.
[Source Microsoft]

Update: The link to the Microsoft page above is dead. They now say the following:
“For an explanation of all the switches for TOC fields, click Quick Parts in the Text group on the Insert tab, and then click Field. Select the Index and Tables category and the TOC field name. Then click Field Codes and then Options. The Field Options dialog box lists all the switches with a description of each.”

Too Much Style

Police Officer: You in the red Corvette! Pull over immediately.
Xander Cage: Yeah, yeah. These monkeys are following me because I just took this car. Obviously the car doesn’t belong to me, it’s not my style
If you are overwhelmed by the number of styles in Word 2007, you can configure Word to show only the styles that are currently being used in the document:
  1. Alt + Ctrl + Shift + s  (opens the style box)
  2. Click on Options on the bottom right
  3. Under Select styles to show choose In use

Now, in the panel on the right you only see what is currently being used in the document.  The ribbon at the top still gives you access to all the styles.  If you apply a style that is not currently being used, then it gets added to the panel on right.

You can also use Ctrl + Shift + s to pop up a window where you can type in a style name. This window has auto complete, so just start typing and the closest match to the style name will fill in.