<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>OT: Word VBA - skip code?</TITLE>
</HEAD>
<BODY>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">Hello everyone</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">Another nasty problem for you.</FONT> <FONT FACE="Wingdings" SIZE=2>J</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">I have been asked to insert an additional line into all our precedent letters (there are a few thousand). So far so doody; I can find the right insertion point and put the line in.</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">What</FONT><FONT SIZE=2 FACE="Arial">'</FONT><FONT SIZE=2 FACE="Arial">s stopping me is that many of the precedent letters have code of their</FONT><FONT SIZE=2 FACE="Arial"> own. Somewhere in the loop below, I need to prevent any code in the Open event of t</FONT><FONT SIZE=2 FACE="Arial">he document from running.</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">If Application.FileSearch.Execute > 0 Then</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial"> For i = 1 To Application.FileSearch.FoundFiles.Count</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">       </FONT> <FONT SIZE=2 FACE="Arial">strN</FONT><FONT SIZE=2 FACE="Arial">ame = Application.FileSearch.FoundFiles(i)</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">        Set</FONT> <FONT SIZE=2 FACE="Arial">objD</FONT><FONT SIZE=2 FACE="Arial">oc = wrdapp.Documents.Open(</FONT><FONT SIZE=2 FACE="Arial">strN</FONT><FONT SIZE=2 FACE="Arial">ame)</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">        If</FONT> <FONT SIZE=2 FACE="Arial">objD</FONT><FONT SIZE=2 FACE="Arial">oc.ReadOnly = False Then</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">            Set myRange =</FONT> <FONT SIZE=2 FACE="Arial">objD</FONT><FONT SIZE=2 FACE="Arial">oc.Content</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">            myRange.Find.Execute FindText:=strFindText, Forward:=True</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">            myRange.InsertAfter strTestText</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">        End If</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">        doc.Close</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial"> Next i</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">The procedures I need to kaibosh all have the same name: Document_Open</FONT><FONT SIZE=2 FACE="Arial"> (obviously)</FONT><FONT SIZE=2 FACE="Arial">, if that helps.</FONT><FONT SIZE=2 FACE="Arial"> How can I get my code to bypass those procedures??</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">Yours hopefully</FONT></P>

<P ALIGN=LEFT><FONT SIZE=2 FACE="Arial">Roz</FONT></P>

</BODY>
</HTML>