Home |
Search |
Today's Posts |
#6
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Macro help!
Actually, if you select the whole of what was the table of contents and do a
wildcard search for ^t([0-9]{1,})^13([0-9]{1,}). and replace it with ^t\2-\1^p\2. it should modify all but the last page number in the table of contents. For an explanation, see the Find and Replace using Wildcards article on the following page of fellow MVP Graham Mayor's website: http://www.gmayor.com/replace_using_wildcards.htm -- Hope this helps, Doug Robbins - Word MVP Please reply only to the newsgroups unless you wish to obtain my services on a paid professional basis. "Adelle Gibson" wrote in message ... Thanks for your help. After I generate a TOC I usually unlink it so that I can insert the section number and a hyphen before the page number. I can't use Word's built-in option for this since the client does not use auto numbering at all. Here's an example of what I am trying to do. 1. Text.......... 1-1 Can someone help me write a macro that will (1) insert a tab, (2) pick up the first number on that line (i.e., 1), (3) add a hyphen before the page number. If it helps, the blank space between the leader tab (set at 6.5) and 1-1 is actually a right-aligned tab set at 7.0. I currently have to input this information manually throughout the entire TOC which, as you may have guessed, is a pain when it is 5 pages long. macropod wrote: Hi Adelle,For a TOC field, the 'correct' way is to edit the relevant TOC 23-Dec-09 Hi Adelle, For a TOC field, the 'correct' way is to edit the relevant TOC Styles. Otherwise the tabs are liable to reappear as soon as you update the TOC field. If the tabs are in the headings being picked up by the TOC, though, you will need to either edit the headings themselves or change the TOC Style to that the two tabs are effectively treated as one (eg by placing the corresponding tab stops as close together as possible - which seems to be about 1.25pts apart). -- Cheers macropod [Microsoft MVP - Word] Previous Posts In This Thread: On Tuesday, December 22, 2009 11:51 PM Adelle Gibson wrote: How to search and replace multiple tabs I am trying to create a macro to search and replace one tab with two in a TOC. Problem is I currently have three tabs set in the paragraph and the one that I want to replace is the second tab. When I run the search and replace it changes the first tab to two. Any ideas on how to get around this problem. Ex (current): 1.(tab)text(leader tab)digit Ex (desired): 1.(tab)text(leader tab)(tab)digit On Wednesday, December 23, 2009 1:37 AM macropod wrote: Hi Adelle,For a TOC field, the 'correct' way is to edit the relevant TOC Hi Adelle, For a TOC field, the 'correct' way is to edit the relevant TOC Styles. Otherwise the tabs are liable to reappear as soon as you update the TOC field. If the tabs are in the headings being picked up by the TOC, though, you will need to either edit the headings themselves or change the TOC Style to that the two tabs are effectively treated as one (eg by placing the corresponding tab stops as close together as possible - which seems to be about 1.25pts apart). -- Cheers macropod [Microsoft MVP - Word] On Thursday, February 11, 2010 10:59 PM Adelle Gibson wrote: Macro help! Thanks for your help. After I generate a TOC I usually unlink it so that I can insert the section number and a hyphen before the page number. I can't use Word's built-in option for this since the client does not use auto numbering at all. Here's an example of what I am trying to do. 1. Text.......... 1-1 Can someone help me write a macro that will (1) insert a tab, (2) pick up the first number on that line (i.e., 1), (3) add a hyphen before the page number. If it helps, the blank space between the leader tab (set at 6.5) and 1-1 is actually a right-aligned tab set at 7.0. I currently have to input this information manually throughout the entire TOC which, as you may have guessed, is a pain when it is 5 pages long. Submitted via EggHeadCafe - Software Developer Portal of Choice Create Hidden SharePoint List for Site Owners http://www.eggheadcafe.com/tutorials...harepoint.aspx |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
search and replace multiple files | Microsoft Word Help | |||
I need to search and replace across multiple files | Microsoft Word Help | |||
find/replace multiple TABS | Microsoft Word Help | |||
Search and Replace in Multiple Files | Microsoft Word Help | |||
How do I search and replace tabs with spaces? | Microsoft Word Help |