Sunday, May 12, 2019

Remove All BookMarks

Sometimes MS Word documents can get loaded with useless bookmarks. Here is a macro to remove them:

Sub RemoveAllBookmarks()
    Dim objBookmark As Bookmark

    For Each objBookmark In ActiveDocument.Bookmarks
        objBookmark.Delete
    Next
End Sub

PowerPoint: Change that Template


To change the template in a PowerPoint document:

Design -> Themes -> (click drop down arrow at end of themes) -> Browse for themes…
Select the template, then Apply.

[Source Powerfinish]

Tuesday, May 7, 2019

Add a Copy Button to Code Blocks

MadCap has a blog post about adding a copy button to code blocks, found here.

Here's what I had to do to get it working:

Step 1: Download the clipboad javascript and put it in your Resources/Scripts folder:
https://github.com/zenorocha/clipboard.js/archive/master.zip

Step 2: Add this to the <head> section:
<script src="../../../Resources/Scripts/clipboard.min.js"></script>

Step 3: Before the final closing body tag (</body>), add this:
<script>new ClipboardJS('.cbtn');</script>

Note: I named the button is named cbtn.

Step 4: Enclose each code block like the following:
<div class="Code">
   <p class="Codeblock" id="t01">Here's my code block text.</p>
   <button class="cbtn" data-clipboard-action="copy" data-clipboard-target="#t01" MadCap:conditions="Default.ScreenOnly"> </button>
</div>

Note: The button class must match what you defined in step 3.
Note: The ID must be unique for each code block.
Note: I added the Default.ScreenOnly condition so that it doesn't appear in PDF/Word.

Step 5: Add the following to your CSS file:
div.Code
{
   position: relative;
   overflow-x: auto;
}
p.Codeblock + button
{
   position: absolute;
   bottom: 0;
   right: 0;
   width: 26px;
   height: 26px;
   margin-bottom: 6pt;
   background: url(/url/to/image/content-copy.png)
}

Note: I use an image for the button, defined in the CSS. If you don't want an image, you can just put the plain text "Copy" in the HTML in step 4.
Note: The positioning places the button at the bottom right corner of the div.

Tuesday, October 9, 2018

Are You a Man or a Bloke?

I recently tested the Mad Quality Plugin for Flare, which is a rule-checking application that uses various rule sets to check your text (kind of like the grammar checker in Word). The tool is a useful plug-in for Flare. Maybe I'll review it in another post.

One of the sample rule sets checks for British English (see the list below). Now, I really like finding all the differences between British and American English. I know what trainers are and sometimes I wear a jumper. But, I have no idea what some of the ones in this list mean.

Do you wrap your leftovers in aerofoil?

What do you do with a breakdown van? Is it really old and doesn't run well?

Courgette? Wasn't she that girl from Les Miserables?

Is a draughts game where you see whose lawn looks the best after not watering it for a month?

Are you insulted if someone asks you if you have a dummy for a baby?

Do you get green fingers after picking your nose?

I think there are some new diseases in England, like mangetoutaubergine, and diamante.

Is a windcheater a type of sailor?

Boob tube? Titbit? Um, maybe I don't want to know what those are.

Here's the complete list. How many do you know?
  1. accommodation
  2. action replay
  3. aerofoil
  4. aeroplane
  5. agony aunt
  6. Allen key
  7. aluminium
  8. aniseed
  9. anticlockwise
  10. articulated lorry
  11. asymmetric bars
  12. aubergine
  13. baking tray
  14. bank holiday
  15. beetroot
  16. biscuit
  17. black economy
  18. blanket bath
  19. block of flats
  20. boiler suit
  21. bonnet
  22. boob tube
  23. boot
  24. bottom drawer
  25. bowls
  26. braces
  27. brawn the food
  28. breakdown van
  29. breeze block
  30. bridging loan
  31. bumbag
  32. candyfloss
  33. car park
  34. casualty
  35. catapult
  36. central reservation
  37. chemist
  38. chips
  39. cinema
  40. cling film
  41. common seal
  42. consumer durables
  43. cornflour
  44. cos
  45. cot
  46. cot death
  47. cotton bud
  48. cotton wool
  49. council estate
  50. courgette
  51. court card
  52. crash barrier
  53. crisps
  54. crocodile clip
  55. cross-ply
  56. crotchet
  57. current account
  58. danger money
  59. demister
  60. dialling tone
  61. diamante
  62. double cream
  63. draughts game
  64. drawing pin
  65. dressing gown
  66. drink-driving
  67. drinks cupboard
  68. drinks party
  69. driving licence
  70. dual carriageway
  71. dummy for a baby
  72. dust sheet
  73. dustbin
  74. engaged
  75. estate agent
  76. estate car
  77. ex-directory
  78. faith school
  79. financial year
  80. fire brigade
  81. first floor
  82. fish finger
  83. fitted carpet
  84. flannel
  85. flat
  86. flexitime
  87. flick knife
  88. flyover
  89. football
  90. footway
  91. fringe
  92. full stop
  93. garden
  94. gearing
  95. gear lever
  96. goods train
  97. greaseproof paper
  98. green fingers
  99. grill
  100. ground floor
  101. groundsman
  102. hairslide
  103. hatstand
  104. hen night
  105. hire purchase
  106. hoarding
  107. hob
  108. holdall
  109. holiday
  110. holidaymaker
  111. homely
  112. hosepipe
  113. in hospital
  114. hot flush
  115. housing estate
  116. hundreds and thousands
  117. ice lolly
  118. icing sugar
  119. indicator
  120. inside leg
  121. jelly babies
  122. Joe Bloggs
  123. Joe Public
  124. jumble sale
  125. jump lead
  126. jumper
  127. junior school
  128. kennel
  129. ladybird
  130. a lettuce
  131. level crossing
  132. lift
  133. lolly
  134. lollipop lady
  135. loose cover
  136. lorry
  137. loudhailer
  138. low loader
  139. lucky dip
  140. luggage van
  141. maize
  142. mangetout
  143. market garden
  144. marshalling yard
  145. maths
  146. metalled road
  147. milometer
  148. minim
  149. mobile phone
  150. monkey tricks
  151. motorway
  152. mum
  153. mummy
  154. nappy
  155. needlecord
  156. newsreader
  157. noughts and crosses
  158. number plate
  159. off-licence
  160. opencast mining
  161. ordinary share
  162. oven glove
  163. paddling pool
  164. paracetamol
  165. parting in hair
  166. patience
  167. pavement
  168. pay packet
  169. pedestrian crossing
  170. peg
  171. pelmet
  172. petrol
  173. physiotherapy
  174. pinafore dress
  175. plain chocolate
  176. plain flour
  177. polo neck
  178. positive discrimination
  179. postal vote
  180. postbox
  181. postcode
  182. potato crisp
  183. power point
  184. pram
  185. press stud
  186. press-up
  187. private soldier
  188. public school
  189. public transport
  190. punchbag
  191. pushchair
  192. pylon
  193. quantity surveyor
  194. quaver
  195. queue
  196. racing car
  197. railway
  198. real tennis
  199. recorded delivery
  200. registration plate
  201. remould
  202. reverse the charges
  203. reversing lights
  204. right-angled triangle
  205. ring road
  206. roundabout
  207. rowing boat
  208. sailing boat
  209. saloon
  210. sandpit
  211. sandwich cake
  212. sanitary towel
  213. self-raising flour
  214. semibreve
  215. semitone
  216. share option
  217. shopping trolley
  218. show house
  219. home
  220. silencer
  221. silverside
  222. skeleton in the cupboard
  223. skimmed milk
  224. skipping rope
  225. skirting board
  226. sledge
  227. sleeper
  228. sleeping partner
  229. slowcoach
  230. snakes and ladders
  231. solicitor
  232. soya
  233. soya bean
  234. splashback
  235. spring onion
  236. stag night
  237. Stanley knife
  238. starter
  239. state school
  240. storm in a teacup
  241. surtitle
  242. swede
  243. sweet
  244. takeaway
  245. taxi rank
  246. tea towel
  247. terrace house
  248. tick
  249. ticket tout
  250. timber
  251. titbit
  252. toffee apple
  253. touch wood
  254. trade union
  255. trading estate
  256. trainers
  257. transport cafe
  258. trolley
  259. twelve-bore
  260. underground
  261. vacuum flask
  262. verge
  263. vest
  264. veterinary surgeon
  265. wagon
  266. waistcoat
  267. walking frame
  268. wardrobe
  269. water ice
  270. weatherboard
  271. white coffee
  272. white spirit
  273. wholemeal bread
  274. windcheater
  275. windscreen
  276. worktop
  277. zebra crossing
  278. zed
  279. zip

Sunday, October 7, 2018

Make APIs Look Nice with Shins

Anyone who is documenting or using APIs has probably come across a new, slick web interface for viewing APIs, like the one in this image:
So, what is this interface? And how do I get my APIs to look like it?

This interface is called Slate. It provides a 3-pane view, with a TOC, the API reference, and code samples. Unfortunately, I am running a Windows machine, and I couldn't get Slate to install.

Fortunately, there is a port of Slate, called Shins (Shins Is Not Slate). This port runs on Windows and uses NodeJS instead of Linux, Ruby, Bundler, etc.

Shins generates the Slate-like output with minimal effort from a Markdown file that contains your APIs. Since my R&D team creates a YAML file, I used widdershins to convert the YAML to Markdown.

Here's what you need to do:
  1. Create a folder on your computer called shins
  2. Clone the Shins repository to your local directory.
  3. Create a folder called widdershins in the shins directory.
  4. Clone the widdershins repo to your local directory.
  5. Copy your latest YAML file into the defs dir:
    .\shins\widdershins\defs 
  6. Change directory to this one:
    .\shins\widdershins
  7. Run the following command:
    node widdershins --search true .\defs\my-api.yaml -o my-api.md
    Note: You can add a flag that lets you choose which languages to include in the output, such as:
    --language_tabs 'javascript:JavaScript' 'shell:Shell'
  8. Change directory to this one:
    .\shins
  9. Run the following command:
    node .\shins.js --logo company-logo.png .\widdershins\my-api.md 
  10. The index.html file in that directory is created with the Slate/Shins output.
Now you have the Slate output. You can now upload the index.html file as well as the pub and source directories to your website.

Monday, April 30, 2018

Word Macro: Set all Columns to the Same Width in Every Table


Use the Word macro code below to set every column in every table to the width of the corresponding column in the reference table.


Sub fixColumnWidth()
'
' fixColumnWidth Macro
'
'
Dim refTable As Word.Table
Dim curTable As Word.Table
Dim i As Long
Dim col As Long

Set refTable = ActiveDocument.Tables(7) 'set this to whatever table is the reference table
For i = 2 To ActiveDocument.Tables.Count ' set the start value. Sometimes you want to skip the 1st table (such as Revision History)
  Set curTable = ActiveDocument.Tables(i)
  
  For col = 1 To refTable.Columns.Count
    curTable.Columns(col).Width = refTable.Columns(col).Width
  Next col
Next
End Sub

[Source: Microsoft Community]

Monday, April 9, 2018

Flare: Thinking Outside the Box

If you have large figures, you can create a style that is larger than your normal margins by using a negative left margin. For example:

p.wideImage
{
margin-left: -35pt;
}

[Source: MadCap Forum]

Tuesday, March 27, 2018

Flare: Creating a Numbered Appendix

Refer to this page for help with the auto-numbering in Flare:

Or just use this in your CSS:

h1
{
mc-auto-number-format: 'GH:{n+}. ';
}

h1.Appendix
{
mc-auto-number-format: 'GM:Appendix {A+}. ';
}

h2
{
mc-auto-number-format: 'GH:{n}.{n+}. ';
}

h2.Appendix
{
mc-auto-number-format: 'GM:Appendix {A}.{n+} ';
}

h3
{
mc-auto-number-format: 'GH:{n}.{n}.{n+}. ';
}

h3.Appendix
{
mc-auto-number-format: 'GM:Appendix {A}.{n}.{n+} ';
}

h4
{
mc-auto-number-format: 'GH:{n}.{n}.{n}.{n+}. ';
}

h5
{
mc-auto-number-format: 'GH:{n}.{n}.{n}.{n}.{n+}. ';
}

h6
{
mc-auto-number-format: 'GH:{n}.{n}.{n}.{n}.{n}.{n+}. ';
}

Welcome to Flare

I've jumped onto the MadCap Flare bandwagon. There's sure to be numerous posts about tips for it.

Helpful links:

Tuesday, February 13, 2018

Modify PDF Metadata, Initial View, and more - for Free!

Do you need to do any of the following tasks in your PDF files:

  1. Edit the Title, Author, Subject and Keywords property fields
  2. Edit the initial view

How can you accomplish these tasks if you don't have Adobe Acrobat?

Just install Debenu PDF Tools. They have a free version that installs a Windows menu command with these functions and more.

Note that for each change that you make it creates a new PDF with the changes.

[Source: gHacks]

Sunday, February 11, 2018

Shades of Gray - Remove Shading

I recently encountered text that had shading on it that was difficult to remove. It looked like this example:


FYI: The text above was generated with the lorem shortcut.

It tried to remove it using the Text Highlight Color tool, but it didn't remove it.

Then I tried to remove it with the Borders tool. I clicked Borders > Borders and Shading > Shading, then changed the Fill to No Color. Clicked OK, and nothing happened.

The trick to fixing it is to apply the shading to the text, not the paragraph. Change Apply to in the dialog to Text.


Click OK, and the shading goes away:


Wednesday, February 7, 2018

Ugly Lines in PDFs

You might have ugly lines in your PDFs, such as these:
The outline on 3 sides of the Note style are 1/2 point, so they should be nice and thin. (Note that the left side is thick by design.) Unfortunately, Adobe makes the lines look strange, and even different at each level of zoom.

But, have no fear - Adobe Acrobat Reader has a preference to enhance these lines that actually makes it pretty ugly. And you can turn it off!

To disable the setting:
  1. Select Edit Preferences
  2. Select Page Display
  3. Unselect the Enhance thin lines setting
  4. Click OK
Your output should now look more like this image:

[Source: Microsoft]

Monday, October 16, 2017

Kill Them All! - From the Command Line

If you ever wanted to kill a process from the command line, there's an easy way to do it.

First, show what processes are running using the tasklist command:
C:>tasklist
Second, use Taskkill to kill it by process name or process ID:
C:>Taskkill /IM firefox.exe /F
C:>Taskkill /PID 26356 /F
The /F flag forces the process to quit.

[Source: Tweaks]

Tuesday, January 17, 2017

Plurals in English, by George Carlin

This may or may not have been written by George Carlin. Since there's no profanity, he probably didn't write it. But, it's still funny.

George Carlin: The English Plurals

We'll begin with a box, and the plural is boxes,
But the plural of ox becomes oxen, not oxes;
One fowl is a goose, but two are called geese,
Yet the plural of moose should never be meese;
You may find a lone mouse or a nest full of mice,
Yet the plural of house is houses, not hice.

If the plural of man is always called men,
Why shouldn't the plural of pan be called pen ?
If I speak of my foot and show you my feet,
And I give you a boot, would a pair be called beet ?
If one is a tooth and a whole set are teeth,
Why shouldn't the plural of booth be called beeth ?

Then one may be that, and three would be those,
Yet hat in the plural would never be hose;
And the plural of cat is cats, not cose.
We speak of a brother & also of brethren,
But though we say mother, we never say methren.
Then the masculine pronouns are he, his & him,
But imagine the feminine: she, shis & shim !

Let's face it - English is a crazy language.
There is no egg in eggplant nor ham in hamburger;
Neither apple nor pine in pineapple.
English muffins weren't invented in England.

We take English for granted,
But if we explore its paradoxes,
We find that quicksand can work slowly,
Boxing rings are square;
A guinea pig is neither from Guinea nor is it a pig.
Why is it that writers write, but fingers don't fing,
Grocers don't groce and hammers don't ham ?

Doesn't it seem crazy that ...
You can make amends but not one amend ?
If you have a bunch of odds and ends ...
And get rid of all but one of them,
What do you call it ?

If teachers taught, why didn't preachers praught ?
If a vegetarian eats vegetables,
What does a humanitarian eat ?

Sometimes I think all people who speak English
Should be in an asylum for the verbally insane.
In what other language do people recite at a play,
And play at a recital ?

We ship by truck but send cargo by ship ...
We have noses that run & feet that smell;
We park in a driveway & drive in a parkway.
And how can a slim chance & a fat chance be the same,
While a wise man & a wise guy are opposites ?

You have to marvel at the unique lunacy of a language
In which your house can burn up as it burns down;
In which you fill in a form by filling it out,
and in which an alarm goes off by going on.
And in closing .....

If Father is Pop .....
How come Mother's not Mop?

Sunday, January 8, 2017

Know Your Organization

Technical Writers work with just about every department within a company. They get a feature description from a Product Manager, an implementation detail from R&D, and the terminology spin from Marketing. They may also deal with Support, Deployment, and whatever other deparments exist in their companies.

When dealing with all these different groups, especially when working in a large company, it helps to understand how the groups work together. This knowledge helps the TW more efficiently deal with his or her tasks, avoid hitting management walls, and know who they need to talk to. Unfortunately, it is only gained after working for the company for a long time.

Some illustrations, like the one below, of different org types were posted over at Bonker's World.
Which one is your current company most like?

[Source: Bonker's World]

Tuesday, January 3, 2017

Make your life easier - customize your MS Word toolbar

You can make your life a lot easier by customizing the MS Word toolbar with functions that you often use.

Here's how.
  1. Click the dropdown arrow () in the toolbar.
  2. Select More Commands...
  3. Click Popular Commands.
  4. Select any command from the list and then click Add>>.

Add whatever commands you usually use. Note the following:
  • You can add a button to run a custom macro.
  • You can add a separator by selecting which is at the top of the list.

I usually add these commands:
  • Para Keep With Next - let's you turn on/off the keep with next attribute.
  • Para Page Break Before - adds a page break before the current line of text.
  • Style - shows the current style and allows you to select a new style.

Tuesday, August 30, 2016

Reopening Old Google Chrome Tabs

I have Google Chrome (GC) configured to open whatever tabs were previously opened when the browser was closed. This setup is great since I often have 10-20 tabs open, and reopening them 1 by 1 would be a pain.

Unfortunately, what happens is that sometimes I'll have 2 separate GC windows open, usually one of them with 20 different tabs (let's call it A) and another with only 1 tab (called B).

A problem occurs if I close the window A first and then window B. Since GC only remembers the tabs on the last window (B) that was closed, when I restart GC it gives me the tabs from window B. Bummer.

There is another feature in GC that let's you open a closed tab. The keyboard shortcut is Cntl-shift-Tab. When you accidentally close a tab, just type the keyboard shortcut and it reopens the closed tab.

And now for the cool part....

When you open GC, if you type Cntl-shift-Tab, it reopens a closed tab from even before you closed the browser. I my case above, when GC is restarted, window B opens. If I type Cntl-shift-Tab, it opens browser window A that was closed!

Wednesday, August 24, 2016

Count the Number of Words using JavaScript in Adobe Acrobat

This is the best hack that I've come across in the last several years.

Many times I wanted to count the number of words in a PDF document. The normal way to do this task is to save the file as a Word doc and then open it in MS Word that calculates the count. You can also upload your file to an online site that will count it (although most companies would probably frown upon sending your precious data to some random 3rd party site).

Today I stumbled across an Adobe forum thread that said that Acrobat can run JavaScript. Hmmm... And then I found another site that explains how to create a custom tool in Acrobat. Put these two together and you get a toolbar button in Adobe Acrobat to count the number of words in the doc.

Here's how to make it work. Note that this is for Acrobat DC.
  1. Open Acrobat.
  2. Click Tools.
  3. Click Action Wizard.
  4. In the button list under the toolbar, click New Custom Command.
    This window opens:

  5. Click Execute JavaScript.
  6. Change the Label to something useful, like "Count words in document".
  7. Change the Tool tip to something useful, like "Counts the number of words in the current document".
  8. Click Command Options...
  9. Paste in the following code:
    /* Count number of words in document */
    var cnt = 0;
    for (var p = 0; p < this.numPages; p++) cnt += getPageNumWords(p);
    app.alert("There are " + cnt + " words in this file.");
  10. Click OK.
  11. Click Don't show options, options are always the same.
  12. Click OK.
You now have a custom command. All that's left to do is make the button that calls it.
  1. Right-click in a blank part of the toolbar.
  2. Click Customize Quick Tools.
  3. Expand the Action Wizard section.
  4. Find your new command and select it.
  5. Click the Add to Toolbar button on the right side of the window.
  6. Click Save.
That's it! You can now open any PDF and just click the button to get a word count.

[Source: KHKonsulting and Adobe]

Sunday, February 28, 2016

List of Conferences for 2016

Over at Firehead, they have a nice list of conferences for this year. Go to one. Learn something new. Schmooze with people. See their site for more details.
FEBRUARY

MARCH

APRIL

MAY

JUNE

JULY

SEPTEMBER

OCTOBER

NOVEMBER

Monday, March 9, 2015

Special Characters in HTML

Did you ever want to put a ✓ into your HTML? Or maybe a © symbool? How about a ♥?

All you need is the correct special character code.

This page gives a long list of possible codes: http://dev.w3.org/html5/html-author/charref


[Source W3]