<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=154472504-01102004><FONT face=Arial 
color=#0000ff size=2>ups.. sorry my bad.. it should be like this... It's Friday 
and my brain has turned into custurd.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=154472504-01102004><SPAN 
class=194331504-01102004><SPAN class=194331504-01102004><FONT face=Arial><FONT 
color=#0000ff><FONT 
size=2></FONT></FONT></FONT></SPAN></SPAN></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=154472504-01102004><SPAN 
class=194331504-01102004><SPAN class=194331504-01102004><FONT face=Arial><FONT 
color=#0000ff><FONT 
size=2>begin&nbsp;&nbsp;</FONT></FONT></FONT></SPAN></SPAN></DIV>
<DIV dir=ltr align=left>
<DIV dir=ltr align=left><SPAN class=194331504-01102004><FONT face=Arial 
color=#0000ff size=2>&nbsp; &nbsp; &nbsp;FootRng:= 
Doc.StoryRanges.Item(wdFootnotesStory);</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=194331504-01102004><FONT face=Arial><FONT 
color=#0000ff><FONT size=2>&nbsp; &nbsp;&nbsp; 
FootRng.Collapse(wdCollapseEnd);<BR>&nbsp;&nbsp; &nbsp; FootRng.Find.Text:= 
txt;<BR>&nbsp;&nbsp;&nbsp; &nbsp;FootRng.Find.Forward:= 
True;<BR>&nbsp;&nbsp;&nbsp;&nbsp; FootRng.Find.Wrap:= 
FindWrap;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FootRng.Find.Format:= True;<BR>&nbsp; 
&nbsp;&nbsp; FootRng.Find.MatchCase:= False;<BR>&nbsp;&nbsp; &nbsp; 
FootRng.Find.MatchWholeWord:= False;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;FootRng.Find.MatchWildcards:= False;<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
FootRng.Find.MatchSoundsLike:= False;<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
FootRng.Find.MatchAllWordForms:= False<SPAN 
class=154472504-01102004>;</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=194331504-01102004><SPAN 
class=154472504-01102004><FONT face=Arial color=#0000ff 
size=2>&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=194331504-01102004><SPAN 
class=154472504-01102004><FONT face=Arial color=#0000ff 
size=2>&nbsp;&nbsp;&nbsp; <SPAN class=154472504-01102004>while 
FootRng.Find.Execute do </SPAN></FONT></SPAN></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=194331504-01102004><SPAN 
class=154472504-01102004><FONT face=Arial color=#0000ff 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN class=154472504-01102004><FONT 
face=Arial color=#0000ff size=2>FootRng.Text:= 'Blah 
blah';</FONT></SPAN></FONT></SPAN></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=194331504-01102004><FONT face=Arial 
color=#0000ff size=2>end;</FONT></SPAN></DIV></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=154472504-01102004><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> delphi-bounces@ns3.123.co.nz 
[mailto:delphi-bounces@ns3.123.co.nz] <B>On Behalf Of </B>Marshall, 
Paul<BR><B>Sent:</B> Friday, 1 October 2004 4:08 p.m.<BR><B>To:</B> NZ Borland 
Developers Group - Delphi List<BR><B>Subject:</B> [DUG] Word 
Automation<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><SPAN class=160495903-01102004><FONT face=Arial color=#0000ff size=2>I'm 
using Word automation to create a report. </FONT></SPAN></DIV>
<DIV><SPAN class=160495903-01102004><FONT face=Arial color=#0000ff 
size=2>Opening a template file, and using Find/Replace to substitute various 
tokens with real data.</FONT></SPAN></DIV>
<DIV><SPAN class=160495903-01102004><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=160495903-01102004><FONT face=Arial color=#0000ff size=2>This 
sort of thing seems to work:</FONT></SPAN></DIV>
<DIV><SPAN class=160495903-01102004><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=160495903-01102004><FONT face=Arial color=#0000ff 
size=2>WordDoc1.Content.Find.Execute(vSearchText, EmptyParam, EmptyParam, 
EmptyParam, EmptyParam, 
EmptyParam,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
EmptyParam, vWrap, EmptyParam, vReplaceText, vAll, 
EmptyParam,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
EmptyParam, EmptyParam, EmptyParam);</FONT></SPAN></DIV>
<DIV><SPAN class=160495903-01102004><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=160495903-01102004><FONT face=Arial color=#0000ff size=2>But it 
only finds and replaces in the body of the document, not in the header or footer 
sections.</FONT></SPAN></DIV>
<DIV><SPAN class=160495903-01102004><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=160495903-01102004><FONT face=Arial color=#0000ff size=2>Can 
anyone tell me what I need to do?</FONT></SPAN></DIV>
<DIV><SPAN class=160495903-01102004><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=160495903-01102004><FONT face=Arial color=#0000ff 
size=2>Thanks,</FONT></SPAN></DIV>
<DIV><SPAN class=160495903-01102004><FONT face=Arial color=#0000ff 
size=2>Paul.</FONT></SPAN></DIV>
<DIV><SPAN class=160495903-01102004><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=160495903-01102004><FONT face=Arial color=#0000ff 
size=2>&nbsp;</DIV>
<DIV><BR></DIV></FONT></SPAN><FONT face=Arial size=1>
<HR>

<P><STRONG>Attention: </STRONG>The information contained in this message and/or 
attachments from AgResearch Limited is intended only for the persons or entities 
to which it is addressed and may contain confidential and/or privileged 
material. Any review, retransmission, dissemination or other use of, or taking 
of any action in reliance upon, this information by persons or entities other 
than the intended recipients is prohibited by AgResearch Limited. If you have 
received this message in error, please notify the sender immediately.</P>
<HR>
</FONT></BODY></HTML>