Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Break Links in Excel 97 CraigH Links and Linking in Excel 1 February 9th 07 05:31 PM
Break Links Sean Excel Discussion (Misc queries) 1 October 25th 06 03:34 PM
Break Links not working !!!! HELP !! WhytheQ Excel Discussion (Misc queries) 3 May 25th 06 02:28 PM
Unable to break links GHawkins Excel Worksheet Functions 0 April 21st 06 07:21 PM
Workbook Autoclose ... Srini Excel Discussion (Misc queries) 1 April 24th 05 01:21 PM


All times are GMT +1. The time now is 04:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"