Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Break all links on autoclose
Hi, I have a Word document linked to an Excel model.
I use the following macro to automatically break all the links in th document when the file is closed. Unfortunately, it is also stoppin the table of contents from being updatable. Is it possible so tha only the links in the body and footers is broken, and the page number and the table of contents remain the same? Thanks in advance, Sub AutoClose() ' AutoClose Macro ' With ActiveDocument.Range.Fields .Unlink Dim oField As Field Dim oSection As Section Dim oHeader As HeaderFooter Dim oFooter As HeaderFooter For Each oSection In ActiveDocument.Sections For Each oHeader In oSection.Headers If oHeader.Exists Then For Each oField In oHeader.Range.Fields oField.Unlink Next oField End If Next oHeader For Each oFooter In oSection.Footers If oFooter.Exists Then For Each oField In oFooter.Range.Fields oField.Unlink Next oField End If Next oFooter Next oSection End With End Su -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Break Links in Excel 97 | Links and Linking in Excel | |||
Break Links | Excel Discussion (Misc queries) | |||
Break Links not working !!!! HELP !! | Excel Discussion (Misc queries) | |||
Unable to break links | Excel Worksheet Functions | |||
Workbook Autoclose ... | Excel Discussion (Misc queries) |