Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting Label Text in WORD

Status
Not open for further replies.

tbl

Technical User
May 15, 2001
175
BE
Can any of you Word specialists please help me with the following........
I have written a macro in Excel which cleans up a mainframe text file, imports it into Excel, saves it as an Excel database, and runs Word from Excel to automatically create labels using data from the database. This all works wonderfully, but I now need to change the text format on the labels so that the "S1" in for example "00344 S1 03/1" appears in font 10 pt while the rest stays in font 20 pt.
If I try to use the macro recorder on my label sheet it just gives an icon of a recorder, but will not record anything that the mouse does.I could edit the labels by hand, but there are 20,000 of them.....

Thanks in advance,

Richard
 
Hi Richard,

Yes, the Word Macro recorder does have that effect. Use the keyboard to move the cursor around in the document - you can still use the mouse for menus. Come back if you are still stuck.

Enjoy,
Tony
 
Thanks for your suggestion Tony.
Unfortunately I don't know the keyboard shortcuts that enable the selection of part of the text of a label. I have managed to get a workable solution using Find and Replace applied to the whole document, (all labels at once). Its not exactly elegant but it works.
So if anyone wants to produce beautifully sorted and formatted labels automatically from a text file, including the ability to print only the differenc between 2 text files, using Excel as the VBA carrier and Word to do the printing, just let me know.

Wonderful Forum !

Richard
 
Hi Richard,

Glad you're sorted, even inelegantly.

There are numerous threads about keyboard shortcuts here (just do a search). Also Word supplies a list of them - go to Tools > Macro > Macros... (or press <Alt><F8>), under &quot;Macros In:&quot; select &quot;Word Commands&quot; and then select Macro &quot;ListCommands&quot; and press Run. You then have two options - the &quot;All Word Commands&quot; gives you 30 or so pages to browse at your leisure.

For your requirements, however, all you should have needed to do was use the arrow keys to get to the start of your text and then held down <Shift> and used the arrow keys to get to the end of your text. Then you should have been able to select Format, etc with the mouse.

Enjoy,
Tony
 
Thanks very much Tony,

I'm going to try it like that and see if I get anywhere.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top