Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Charles Kenyon
 
Posts: n/a
Default

There is a difference between unlink and lock. The difference is that
locking maintains the field structure and you can later unlock. This may not
matter with what you are doing. For me, it often does matter. Unlinking,
essentially, is permanent. On the other hand, it is a method rather than a
property.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"S.P." wrote in message
...
Thank you so much!
I found your own (!) examples at
http://www.addbalance.com/word/faq_s...m#updatefields
The solution was the "StoryRanges", and the nested loop
Here's the working Script:


Set MM = ActiveDocument.MailMerge

MM.OpenDataSource Name:="c:\pdb.mer"
MM.ViewMailMergeFieldCodes = False
MM.DataSource.Close

For Each SR In ActiveDocument.StoryRanges
For Each F In SR.Fields
If F.Type = wdFieldMergeField Then
F.Unlink
End If
Next F
Next SR

End Sub




"Charles Kenyon" schrieb im
Newsbeitrag ...
The following works for Ref field updating and should give you a leg up.
Private Sub RefFieldUpdateAllStory()
' Written by Charles Kyle Kenyon 15 November 2001
' repaired by Jezebel
' All Story Field Updater - Ref fields
Dim oField As Field
Dim oStory As Range
'
For Each oStory In ActiveDocument.StoryRanges
' This goes into headers and footers as well as the regular document
Do
For Each oField In oStory.Fields
If oField.Type = wdFieldRef Then
oField.Update
End If
Next oField
Set oStory = oStory.Next
Loop Until oStory Is Nothing
Next oStory
End Sub

--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"S.P." wrote in message
...
I want to do a one-time (no update) MailMerge, into the existing
document.
The permanent "locking" almost works with

Set myFields = ActiveDocument.Fields ' or
ActiveDocument.MailMerge.Fields ?!?
For Each fn in myFields
If fn.type = wdFieldMergeField Then
fn.Unlink
End If
Next fn

Problem: the Fields in the header are not affected (which is good for
page numbers...but for that I have the " If fn.type = ..." ).

-- How can I unlink Mergefields in headers?

I just can't find the ActiveDocument.Fields equivalent for headers.







 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Number and Page header on the first page Frank Drost Formatting Long Documents 3 March 1st 05 02:17 PM
Header changes with text outside of header Connie Martin Microsoft Word Help 3 February 22nd 05 06:58 PM
Header and Footer robin Microsoft Word Help 4 January 12th 05 04:17 PM
How do I reformat a header on page 2 to be different from the hea. Ckanegae Microsoft Word Help 1 December 28th 04 10:43 PM
Same header but even/odd footer (sorry for the new thread) B?atrice Karjalainen Page Layout 1 December 16th 04 12:40 AM


All times are GMT +1. The time now is 03:34 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"