
Results to see what text works best for you. You will need to run the macro a few times and check the Is already followed by something in brackets, then you willĮnd up with text as in Figure 3.
TEXT TO TABLE WORD MACRO FULL
Works for my documents regardless of whether the hyperlink isįollowed by a full stop (period) or a space. This requires some thought as you need toįind a single string of text that will always work. The lines r.InsertAfter allow you to define the text surrounding the page number to Range:=r, Text:="PAGEREF " & h.SubAddress End If Next i R.InsertAfter Text:=" (See page " r.Collapseĭirection:=wdCollapseEnd r.InsertAfter Text:=")" r.Collapseĭirection:=wdCollapseStart

InStr(h.SubAddress, "_Toc") = 0 And h.Address = "" Then Integer Dim h As Hyperlink Dim r As Range For i =Ī To 1 Step -1 Set h =ĪctiveDocument.Hyperlinks(i) Set r = h.Range If 'The InsertAfter Text amended by Peter Grainge Dim i As The macro below will amend your document so that it reads asĬlick in the field below and then press CTRL + C to add the Now thanks to HansV, a long term supporter of Woody's Lounge, They have to go to the Table of Contents and locate "Program Someone reading hard copy? It's not much use to them is it? TheyĬan click the hyperlink and see Program Access. Which is fine for anyone viewing the document on a PC. Printed documentation, you may have something like Figure 1 Page Numbers after hyperlinks in RoboHelp Printed Into Word, open the file with a text editor such as Notepad. If you want to see the content of the bas file before importing it OR customise a toolbar and add the macro there. Then either go to Tools | Macro | Macros, select the macro and click Then right click the module and select Import. Try Tools | Macros | VBA Editor ORĬreate a new module as shown below. The zip files each contain a bas file for import into Word via the WinZip) will open and display the contents of the zip file.
TEXT TO TABLE WORD MACRO HOW TO
How to Add a MacroĬlick on any link below to download the required zip file.ĭepending on your operating system and security settings, you willĮither be prompted to save the zip file or your zip application (e.g.


They will most likely work in later versions but as with running any macro, create a back up of your file before you start. These macros were created for the version of Word current at the time. A selection of Word macros that I have written, been helped with or found.
