Re: Latent Merge Fields

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Ken (Ken_at_discussions.microsoft.com)
Date: 10/18/04


Date: Mon, 18 Oct 2004 06:59:03 -0700

Peter,

Thanks for sharing your extensive insght. I ran your first code fragment,
because I want to permanmently remove the mergefield references and leave
only the "resilts" in the document.

After executing the code, all of the references were removed from the main
text - I gather this is true because I could no longer display the chevron
versions with Word's "View Merged Data' button.

Except those merge fields in the document's header. These merge fields were
not unlinked.

I ran the code against the document in mege Letter form, before converting
to a 'Normal Word Document'.

The ActiveDocument.StoryRanges.Count is 5. And the StoryRanges.StoryType's are

wdMainTextStory
wdFootnoteSeparatorStory
wdFootnoteContinuationSeparatorStory
wdEndnoteSeparatorStory
wdEndnoteContinuationSeparatorStory

Shouldn't there be a wdPrimaryHeaderStory in that collectiion for this
document? Is that why the merge fields are not unlinked rom the header? As
usual I'm confused.

Thanks for you help,

Ken

"Peter Jamieson" wrote:

> What happens is that when you convert to a Normal Word Document, all that
> happens is that the data source and any filter and sort specifications are
> removed. All the merge field are actually still there, and their "preview"
> results will show the values of the data source record that was current at
> the time the conversion occurred.
>
> If you get to that point, then e.g. select any of the fields and press F9,
> you will see the field's name displayed in chevrons (exactly what you see
> may depend on other settings in Tools|Options|View).
>
> When you print or preview, some field types in some parts of the document
> are automatically executed and others are not. The settings
> Tools|Options|Print|Update fields and possibly Tools|Options|Print Update
> links may have a bearing on this (i.e. I am guessing that that may be the
> source of the differences on your customer's systems). In this case, the
> ones in the header/footer are executed and you see the chevron versions cf.
> when you press F9.
>
> If you want to see the /results/ and never the chevron versions, I suggest
> you do e.g.
>
> Dim oStoryRange As Range
> For Each oStoryRange In ActiveDocument.StoryRanges
> oStoryRange.Fields.Unlink
> Next
>
> If you want to see the chevron versions only, perhaps
>
> Dim oStoryRange As Range
> For Each oStoryRange In ActiveDocument.StoryRanges
> oStoryRange.Fields.Execute
> Next
>
> will work (I haven't tried). I don't know how you could leave the chevron
> versions but display the preview results.
>
> --
> Peter Jamieson
>
> "Ken" <Ken@discussions.microsoft.com> wrote in message
> news:AB54870D-DF5E-4C22-BCE6-377A2D222555@microsoft.com...
> > A main docunment is created with Word 2003 mailmerge automation. Before
> > saving the document, its converted from a mailmerge 'Letter' to a 'Normal
> > Word Document' using the Main Document Setup icon on the mailmerge
> toolbar.
> >
> > The associated query is removed from the document and all mailmerge fields
> > are instantiated, except those in headers.
> >
> > Why are the merge field references not removed from a header?
> >
> > This problem does not occur on all of our customer's workstations. Some of
> > the Office 2003 installations remove all merge field references when
> 'Normal
> > Word Document' is selected with the Main Document Setup.
> >
> > Thanks for your help with this problem.
> >
> >
>
>
>



Relevant Pages

  • Re: Latent Merge Fields
    ... > the StoryRanges collection does not hit the header object in my document. ... >>> ones in the header/footer are executed and you see the chevron ... >>> Dim oStoryRange As Range ...
    (microsoft.public.word.mailmerge.fields)
  • Re: HylaFax receives rubbish
    ... Hijacking a thread has *nothing* to do with using a subject that's the ... "References:" header would be present. ... Hakim -- was the one that Wayne Topa replied to, ...
    (Debian-User)
  • Re: [slrn] MIDS in Subject, not References header
    ... in between the "References:" and the first MID ... | Subject: Re: help with firefox issue ... field name + colon and before the field value. ... 'A header may be "folded"; that is, a CRLF pair may be placed before ...
    (news.software.readers)
  • Re: Snipping MIDs from the References: header
    ... What exactly are the rules on snipping MIDs out of the References: ... implementation to impose a limit on the length of header lines, ... a followup agent MAY do this by deleting some of the message IDs. ...
    (news.software.readers)
  • Re: Thread and subject changing
    ... To discuss when and how a replier should ... For others not threading by subject header, ... it easier to convert the citation and attribution from a previous ... with no old references? ...
    (news.software.readers)