Short takes: iPhone broadcasting wrong number; fractions in HTML; Word comment authors

Another collection of things I found on the Internet that might or might not be useful for other people.

SMS and phone calls using the wrong number on an iPhone

In common with most people who “work in IT”, I get called upon for family IT support. In truth, I get called upon a lot less since my trainee geek (aged 12¾) deals with most of that for me! Last weekend though, he was stumped by the problems my Mother-in-law was having with her iPhone.

She’d bought a new phone and changed providers, then ported her number to the new provider. Although calls were reaching her with the correct number on her SIM, SMS and outbound calls were using the temporary number allocated prior to porting her “real” number.

I found the solution via the Giffgaff forums – where essie112mm describes a combination of steps including turning iMessage and Facetime on/off. The crucial part for me was Settings, Phone, My Number – where I needed to edit the number to the one that we wanted to use.

Writing fractions in HTML

In the previous section, I wanted to write ¾ using the correct HTML. As it happens, WordPress has taken our my HTML ¾ and replaced it with a raw ¾ symbol but I found this article by Charles Iliya Krempeaux (@Riever) useful reading for representing less common fractions in HTML.

Microsoft Word removes the author name from comments

I write a lot of documents in my professional life. I review even more for other people – and I use the reviewing tools in Microsoft Word extensively. One “feature” that was frustrating me though was that, every time I saved a file, my comments changed from “Mark Wilson” to “Author”.

My colleague Simon Bilton (@sabrisual) pointed out the fix to me – buried in Word’s options under Trust Center, Trust Center Settings, Privacy Options, Remove personal information from file properties on save (thanks to Stefan Blom in this TechNet forum post).

Remove personal information from file properties on save

It seems that our admins have set this by Group Policy now so I won’t have the problem any more but it’s a useful one to be aware of…

Bids, tenders, requests for information and word counts…

I won’t go into the details (internal company stuff that shouldn’t be on a blog) but at the moment I’m working on a lot of bids, tenders, requests for quotations, requests for information, etc., etc.

I’ve done this sort of work before and it’s not a great fit for me but sometimes it has to be done. It’s my turn. But I hadn’t realised until recently why it is that I struggle so much…

Over the years, I’ve learned to deal with ambiguity; I’ve learned how to respond without having all the facts. I can write convincing copy (at least I think I can) and I can usually spell (despite a colleague suggesting yesterday that I should check a dictionary because “siloes” didn’t look right to him and maybe it should be “silo’s” – arghhh!).

It was my wife who pointed out to me that the very same attributes and skills that help me as an architect (general pedantry; taking the time to consider the various consequences of choices made; a desire to put in place controls to get things right and to do them well) hinder me in a high-pressure sales environment where I don’t have time to think and where everything is urgent/important and needs to be done NOW (or very soon after now)…

…and relax. Because it’s Friday night. And, in a short while, I will have a beer, or a glass of wine, in my hand.

Anyway, what is the point of this drivel? The ranting ramblings of an Architect? No. Ah, yes, word counts.

Counting words in a document – or in a cell in a spreadsheet…

Lots of bid responses are limited in the number of words that can be accepted. Often, the tool I’m using is Microsoft Word and it’s pretty easy to show the word count for a document or part of a document. Sometimes though, I’m using a different tool to create a document. Like Microsoft Excel.

I was working on a form of response that lists several skills and requires a response of less than a hundred words for each. Sounds easy? Maybe, but thirty 100-word responses are still 3000 words… and only having 100 words to detail experience can be limiting sometimes.

I needed a method to count the number of words in a cell of the spreadsheet and, as usual, I found the answer online:

=IF(LEN(TRIM(A1))=0,0,LEN(TRIM(A1))-LEN(SUBSTITUTE(A1," ",""))+1)

Basically, this compares the length of a string with the length of the same string with all the spaces removed and adds 1 (for a single word with no spaces) or returns 0 if there is nothing in the cell (the TRIM function removes any extra spacing). It’s pretty crude but assuming no hyphenated words or solidi (oblique slashes) it will give a good enough count of the number of words in the cell. Definitely a time-saver for me…

Bonus tip

Excel does have a spell checker – it’s just not very obvious. Just press F7 (or go to the Review menu, then choose Spelling). This only works in the desktop client – not Excel Online.

Short takes: search for new lines in Word; fix HTML <code> text wrapping in CSS; hidden elements in a WordPress theme

Another mini-blog post under the “short takes” banner…

Search for new lines when reformatting text in Word

Unix admins will probably scoff at me as they can probably cat, awk and sed this (or something like that) but I needed to take a list of values from a web page and convert them to a list in a single command earlier this week. The basic steps I used were:

  1. Copy text from table on HTML page
  2. Paste into Excel
  3. Delete unrequired columns
  4. Save as text

That gave me a file with a list of values (in this case a list of audio or video file formats) but it was one column and I wanted a row to include within some very long PowerShell commands.

  1. Open in Word
  2. Find ^p and replace with ,

The way that this works is that ^p will search for new lines in Word (actually, it’s looking for new paragraphs, and ^l will find a new line). This worked for me in Word, but not in WordPad.

Wrapping text in HTML code snippets

For years (ever since Garry Martin wrote a one of his guest posts on this blog), I’ve been using a WordPress plug-in called DirtyCode to format code snippets that wrap to multiple lines.

The plug-in is no longer maintained though, and WordPress’s visual editor strips out the <dirtycode> tags so I’ve been wanting to fall back to the standard HTML <code> tag. Unfortunately that doesn’t text wrap in my theme, so I had to find a way to stop long lines of code running out of the frame.

The fix (or maybe it’s a fudge – if I could work out how to make custom CSS stick on theme changes, I would) was to edit my WordPress theme’s stylesheet (style.css) to include the following inside the existing code { } line:

word-break: break-all; white-space: pre-wrap;

Hidden elements in a WordPress theme

On a related note, I had some issues with elements not displaying properly in my new theme either. The WordPress forums came to my rescue though – it seems the tag line that I couldn’t see was there but hidden, until I added the following code to the custom CSS:

.site-description { color: #CCCCCC; display: block; }

Short takes: refreshing all the fields in a Word document; fixing the spacing after a table in Word

More snippets of info from the last few weeks… this time with a focus on Word…

Refreshing all the fields in a Word 2013 document

I was writing a pretty sizable document recently, with many tens of tables, a few figures and lots of cross references so I wanted to be able to easily update all the fields in one fell swoop. Well, it turns out to be remarkable easy to do, if not immediately obvious, in Word 2013 (and it seems it works for older versions too). Just go to Print Preview and the fields will be updated!  You’ll still need to manually update tables of contents, etc. if you’ve added/removed sections, but all the other fields in the document will be taken care of.

Fixing the spacing after a table in Word

Another challenge I had with my document was that it included a lot of tables, and after each table the following line was too close.  If I included a blank line, it was too big (and anyway, that’s not the right answer); and if I edited the Normal style then it would affect the rest of the document.

I found some suggestions in a post from Allen Wyatt. The first was to amend the table positioning and set top and bottom spacing but that involves letting text flow around the table (and potentially tables floating off around the document in the same way as so many pictures do…). The simpler approach was to create a new style, based on Normal, called After Table, which has the appropriate paragraph spacing set. No more ghastly gaps and dodgy new lines – instead I just use the After Table style on the paragraph immediately after each table.

Short takes: text editing; Windows Phone; and recovering deleted images…

More snippets from the life of a geek playing at being a manager in the IT industry…

Replacing text with a carriage return/line feed in Windows Notepad

It’s a long story but I needed to find out how many people are in our department, at a level above me.  My manager is on holiday, so I couldn’t ask him. Instead, I drafted an email to the whole department, expanded the distribution list and then counted the names…

Of course I didn’t quite do it like that… I pasted the list into a text file (which I thought I’d import to Excel as a CSV and then count the number of rows). That didn’t work out (I got 111 columns instead and I lost count shortly after AA, AB, AC, etc.) so I tried replacing the “; ” with line feeds in Notepad. Notepad can’t do that, but Word canCtrl+H will open the find and replace dialogue and using ^p as the string for the replacement will insert a new paragraph mark. 111 replacements were made (hence 111 names).

Changing the voicemail number on my Windows Phone

One of the issues with my iPhone is that I can’t change the voicemail number from 901 (O2 – the network my phone thinks it’s on) to 443 (Giffgaff – the MVNO that my account is actually with).  I’ve jailbroken and hacked around with config files but it doesn’t work on iOS 7.0.4.

Thankfully, my Nokia Lumia 625 (running Windows Phone 8) is a little more flexible.  When new, it asked me what the voicemail number I needed was.  In the absence of any information from my service provider (EE), I googled and found information that suggested it was +447953222222. My IT department later suggested I should use +447973100123 and changing it is as simple as hitting the ... in the phone app and entering settings, then changing the voicemail number.  As my messages are still intact, I guess that both numbers actually end up in the same location…

Turning off Twitter’s lock screen updates on Windows Phone

Talking of Windows Phone, when I installed the Twitter app it asked if I wanted to see selected tweets on my lock screen.  It seemed like a good idea at first, until I realised I couldn’t actually click on them.  Turning off the Twitter lock screen updates was difficult to hunt down – it’s not set via the Twitter app settings but in the lock screen settings, as Jamie Thomson (@jamiet) and Craig Hawker (@craighawker) highlighted to me.  Thanks guys.

Recovering deleted images from a camera flash drive

Of course, any of us who work in IT know that we automatically get to provide a family IT support service.  I shouldn’t complain because, after my parents in-law paid for someone to do some work on their PC I was horrified to see that he had removed Microsoft Security Essentials and added AVG (which I had removed because it kept nagging to upgrade to a paid version), installed a load of unnecessary software (Defraggler, Firefox, etc.).  My “keep it simple, stupid” approach to septuagenarian IT had been destroyed by someone who wanted to inflict his way of computing on others.

Anyway, back to the point…

…My Mother in-law was disappointed to find she was missing some images on her digital camera.  She swears the camera did it by itself (I suggest it was user error) but, critically, no new pictures had been taken since.  Following advice from PC Advisor, I used a free application called Recuva to restore the deleted files on the memory card (ironically, from the same software company that creates Defraggler, the tool I said was unnecessary a little earlier).  It was beautifully simple, although I was unable to get Windows to recognise the camera as a drive (it does depend on the camera) and had to mess around with card readers instead.

Short takes: searching in Outlook; duplexing in Excel; merging in Word; and going wild in Salesforce

This week I’ve mostly been… working in pre-sales. Consequently, this is perhaps not the most exciting blog post I’ve written… but hey, it’s a post and there haven’t been many of them recently!

First up: searching Outlook

Since I changed jobs in April, my email volume has increased by 300x. My mail archive has more messages in it as we approach the end of June than it did for the whole of 2012, and most of them have been sent/received in the last three months.  In short, being able to quickly and accurately search Outlook is important to me.

Microsoft’s website has some good advice for narrowing search criteria for better results in Outlook – for example, if you’re looking for that email from Mark Wilson with the attachment you needed? Try from:"Mark Wilson" hasattachment:yes.

Next: opening two Excel workbooks side by side

If someone sends you a spreadsheet that you need to complete, and there’s information to pull from another spreadsheet, it can be a nuisance to keep switching back and forth between windows inside the application. The answer is to use Task Manager (taskmgr.exe) to open a new copy of Excel so you now have two running processes.  Each one can be used to open a different workbook (e.g. on different monitors) and contents can be copied back and forth.

Then: merging revision comments in Word

Perhaps you work in a team where instead of collaboratively editing one document, people each create their own versions with their own comments? Thankfully, Word 2010 (and probably other versions too) can merge the comments and changes into a single document. That single feature saved me hours this morning…

Finally: wildcards in Salesforce.com reports

My final tip from “Mark’s exciting week in pre-sales” (I jest) was gleaned whilst trying to create a report in Salesforce.com to show my team’s pipeline. I can’t rely on opportunities being correctly tagged, so I needed a report that used searches on a number of fields (and a filter to apply Boolean logic) but was picking up some false positives.  The problem was that one of the search criteria was also a partial match on some other results.  By changing the “contains” criteria from thing to thing*, I got just the results that started with “thing” and not the ones that included “thing” (like “something”).

That explanation is not as clear as I’d like, but I don’t want to spill the beans on some proprietary information – just take a look at the Salesforce.com advice for refining search using wildcards.

Greyed out button for adding bookmarks in Microsoft Word

This week, I finally put the finishing touches on a white paper I’ve been writing for my employer (once it’s published, I’m sure I’ll be linking to it). Usually, the stuff I write is fairly straightforward – nothing more complex than a Word document with associated styles, a table of contents, the odd field here and there, a few cross references. This time though, I found myself using some functionality that I’ve not used previously – like the citation/biblography functionality and also some bookmarks (to refer to sections of the document that weren’t labelled as headings or captions).

I couldn’t work out why adding bookmarks was not available (the Add button was greyed out) but the trick is to ensure that the bookmark name has no punctuation in it (except an underscore).

Changing Word’s bibliography style to use square parentheses

One of my main activities right now is writing a white paper discussing how linked data potentially provides a solution to one of the problems that big data creates. I’m sure I’ll tweet the link when it’s published but, for a sneak preview of the main points, check out my lightning talk at CloudCamp London next week.

Unlike most of the stuff I create these days, it’s written for architects, rather than for a CIO/CTO and so the style is more of a technical journal than a piece of marketing collateral. That’s meant lots of graphics and fully-detailed sources. I’ve never used the citation capabilities in Microsoft Word before (I did write my dissertation in Word 2.0 for Windows, but that was in 1994 and it was still fairly feature-light then!) but I’ve been pretty impressed at its ability to create a bibliography for me.

Word lets me choose from a variety of bibliography styles but I have chosen ISO 690 (Numerical Reference). The only problem with this is that it uses normal round parentheses () rather than square parentheses [] which can be confusing when a sentence contains both text in parentheses (brackets) and a citation (1).

Custom Word 2007 bibliography styleA bit of googling turns up various solutions involving editing XSLT stylesheets but that all seems a bit of a pain. Then I found that “Yves” on CodePlex has already done the work and released ISO690NmericalSquare.XSL.  After downloading this to %ProgramFiles%\Microsoft Office\Office12\Bibliography\Style and restarting Word (2007 in my case – there’s anecdotal evidence to suggest it would work for Office14/2010 too), I have a new option in the bibliography style dropdown and my citations are all labelled with square parentheses.

 

Replacing text with special characters in Microsoft Office Word

This evening I was trying to take a few Exchange Server distribution groups and import their membership to Excel. There’s probably a way to script this but the method I used was to expand the distribution group membership in Outlook, then copy and paste the contents to a text editor before reformatting for Excel. The problem was that I wanted to move from a list of names separated with semicolons to a vertical list of names separated by line breaks.

Using Word (2007) as my editor, I tried to replace ; with a line break copied and pasted from another document but that didn’t work. It turns out that there is a method to replace using control characters though, as described in a Microsoft help and how-to article about finding and replacing text.

For my situation, I needed to type ^p (or ^13) as the replacement for ; but other options include:

Find/replace Type
Paragraph mark (¶) ^p (except with wildcards) or ^13
Tab character ^t or ^9
ASCII character ^nnn where nnn is the character code
ANSI character ^0nnn where nnn is the character code
Em dash (—) ^+
En dash (–) ^=
Caret (^) ^^
Manual line break ^l or ^11
Column break ^n or ^14
Page (when replacing) or section break ^12
Manual page break ^m
Non-breaking space ^s
Non-breaking hyphen ^~
Optional Hyphen (¬) ^-

These may be useful to know – and there are more find and replace options in the article, including wildcards.

Reviewing documents? Forget about review sheets and use the features in Word instead!

A few weeks back, I was taking part in a document review process where the prescribed format of the review involved recording all the document comments on a separate sheet and then sending them back for consideration. Describing where the change/comment applied (e.g. section 1.1, paragraph 4, it states “blah blah blah” but really it should be “something entirely different”; section 2, last paragraph, extraneous apostrophe in PC’s; etc.) is a very labour intensive process for all the reviewers involved – it’s far easier to work through a work document and add comments/tracked changes as required.

Today, I was on the receiving end of some comments on one of my designs and I had the opposite problem – several documents with comments embedded to wade through (and one on a review sheet for good measure… grrr).

The obvious issue with receiving several documents with embedded comments/changes is how to merge all of the separate review comments into one place – and it turns out that’s easily done using Word 2007’s built-in tools for combining and comparing documents (Word 2003 has similar functionality on the Tools menu – Compare and Merge Documents…).

Compare and combine tools in Microsoft Word 2007

Once I had all the review comments merged into a single document (which only took a few seconds), I could track changes, make my edits (the review pane is useful here to jump between comments) and send it back for final sign-off. A few minutes later I had confirmation that the changes were approved, following which I accepted the changes in the document, removed hidden metadata (using the document inspector) and published the document.

It’s all quite straightforward really – the trouble is that most of us still use our office applications in the same way that we did 15 years ago… and, dare I say it, aside from knowledge workers using word processing software on a PC instead of relying on secretarial staff, the basic process probably hasn’t changed much since the days of the typing pool…