Simple clear advice in plain English

Hands on: Writer’s tools

Give your word processing a boost with some of these suggestions

If you already have an Autonew macro for that template, just add the second line, placing it immediately above the existing End Sub line. Save and close the template. Each time you create a new document based on the template you’ll find the insertion point is right where you want it.

You may want to sequentially number every document based on a particular template. One obvious example is producing invoices. There are several ways of doing this, but the simplest is to use an Autotext entry in the template. So open the template, type ‘Invoice number:’ somewhere suitable, followed by the number you want to start from. Highlight the latter, then Insert, Autotext, New. Give it a name, such as ‘currentnumber’ (don’t worry, you won’t ever have to type it out), and with the number still selected create another bookmark, named ‘invnum’.
Now add the following code to the Autonew macro:

lastnum$ = ActiveDocument.AttachedTemplate.AutoTextEntries("currentnumber")
currnum$ = Str(Val(lastnum$) + 1)
ActiveDocument.AttachedTemplate.AutoTextEntries("currentnumber").Value =currnum$
ActiveDocument.Bookmarks("invnum").Select
ActiveDocument.AttachedTemplate.AutoTextEntries("currentnumber").Insert Where:=Selection.Range
ActiveDocument.AttachedTemplate.Save

Taking this line by line, this first reads the value of the ‘currentnumber’ Autotext entry and assigns it to the variable ‘lastnum$’. It than increments the value of this by one, and stores the result as ‘currnum$’. The line that follows updates the Autotext entry to the incremented number, and the line after that selects the ‘invnum’ bookmark. The penultimate line inserts the updated Autotext entry at the bookmark, and finally the macro saves the template file to include the updated Autotext entry.

Another thing you might want to do with an invoice is automatically insert a ‘pay by’ date based on the invoice date. Let’s say you want to give your customers 30 days to pay up. So, at an appropriate point in the template, type ‘This invoice is due for payment by’, followed by a bookmark named ‘payby’. Then create the following macro code.

ActiveDocument.Bookmarks("payby").Select
Selection.TypeText Text:=Format(Date + 30, "d mmmm yyyy")

This will insert a date 30 days in the future. It inserts it as plain text so it won’t change when fields are updated.

Look, don’t touch
The Microsoft Word Viewer is a free download from Microsoft. As the name suggests, it lets you view Word files without having Word installed. You can download the Compatibility Pack for Word, Excel and Powerpoint 2007, also free, from http://tinyurl.com/ykums3, and with both installed you’ll be able to view Word 2007 Docx files as well as the earlier Doc files. You’ll also be able to view Microsoft Works and Wordperfect documents.

Whereas this is obviously useful for someone who doesn’t have any version of Microsoft Word or Office installed, but would like to be able to read and print documents, it has other uses. If you open an old Word for Windows or Dos document you may find that Word changes all the dates therein to the current date. This can make it rather difficult to ascertain when, say, a letter was first written. What is happening here is that originally a ‘today’ date field was inserted instead of a static date. It’s not so easy to make that mistake in later versions of Word – you can either insert a Create Date field, which returns the date and time the document was first saved, or insert a date without the ‘Update Automatically’ option selected. If you don’t save the file, then the original dates are there somewhere, and it’s possible to lock the fields so this doesn’t happen. The Word viewer does not do this updating, so it’s a much less troublesome way of reading old files.

Easier indexing
Feedback is still coming in from our four-month marathon on long documents. In January’s column we wrapped up the series with a look at indexing. This prompted a mail from Alan Fagg. Alan writes user guides and manuals for bespoke software for the oil and gas industries, and remarks that indexing in Word is a pain.

Over the years he has written various macros to make this simpler, such as stepping through indexed words from the index itself, adding sub-entries from a dropdown list of main entries, deleting words from the index and so on. He has put all of these together into a set with a toolbar that he sells ‘for a pittance’ as shareware.

We’ve tried this out and it is rather good. You can try before you buy at www.flair-consultants.com/indexing_ tools.html. This fully functional version comes with – in Alan’s own words – ‘an annoying pop-up window’, but you can purchase a version free from pop-ups for a modest £9.99.

Article tags

Reader Comments

   

Add your comment

All fields must be completed. Your email address will not be displayed or used to send marketing messages.

All messages will be checked by moderators before appearing on the site.

See our Privacy Policy for more information.

Related articles

Better bookmarks

How to insert and use bookmarks, and rooting out the curious logical not sign

New for Office 2007

There are lots of new features in the latest version of Microsoft’s Office but is it worth upgrading immediately?

Hands on: Index words and their entries

Learn how to create an intelligent list of index words in a variety of programs

Question & Answer

Q.Why are some of the keys on my keyboard doing strange...

> Read the answer

Q.Is my phone’s Bluetooth any use?

> Read the answer

Q.Can I switch boot drives so that I can work on older...

> Read the answer

Best deals on the web

img

Samsung RV520-A07

£359.98- Buy it now

img

Acer Aspire 5750G (LX.RXP02.019)

£399.99- Buy it now

img

Apple MacBook Pro (MD313B/A)

£904.37- Buy it now

Latest issue & subscription deals

Poll

Are you concerned about viruses that target mobile phones?

Jargon Buster

Computing terms explained in plain English

Restore point

A Windows backup of system files and settings.

Great shopping deals from Computeractive