<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>OT: Word VBA - skip code?</TITLE>
<META content="MSHTML 5.50.4923.2500" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=501040314-22072003><FONT face=Arial color=#0000ff size=2>Just
read this in the help file....</FONT></SPAN></DIV>
<DIV><SPAN class=501040314-22072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV><SPAN class=501040314-22072003>
<H2><A name=pphowprotectfromviruses_2></A>Security levels in Word</H2>
<P class=T>Microsoft Word offers the following levels of security to reduce the
chances that macro viruses will infect your documents, templates, or add-ins:
<UL>
<LI class=LB1><B>High</B> You can run only macros that have been
<A class=pop
href="javascript:HelpPopup('oftip9.hlp','IDH_ofdefDigitalSignature');">digitally
signed</A> and that you confirm are from a trusted source. Before trusting a
source, you should confirm that the source is responsible and uses a virus
scanner before signing macros. Unsigned macros are automatically disabled, and
Word opens the document without any warning.<BR></LI></UL>
<DIV class=LB1><SPAN class=501040314-22072003><FONT face=Arial color=#0000ff
size=2>Notice the last part that says "...opens the document without any
warning." Change your security settings to High and make sure the document is
not digitally signed and the document isn't from a trusted source (if you must,
delete the trusted source).</FONT></SPAN></DIV>
<DIV class=LB1><SPAN class=501040314-22072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV class=LB1><SPAN class=501040314-22072003><FONT face=Arial color=#0000ff
size=2>Scott</FONT></SPAN></DIV></SPAN>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Roz Clarke
[mailto:roz.clarke@donnslaw.co.uk]<BR><B>Sent:</B> Tuesday, July 22, 2003 9:21
AM<BR><B>To:</B> AccessD (AccessD@databaseadvisors.com)<BR><B>Subject:</B>
[AccessD] OT: Word VBA - skip code?<BR><BR></FONT></DIV>
<P align=left><FONT face=Arial size=2>Hello everyone</FONT></P>
<P align=left><FONT face=Arial size=2>Another nasty problem for you.</FONT>
<FONT face=Wingdings size=2>J</FONT></P>
<P align=left><FONT face=Arial size=2>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 face=Arial size=2>What</FONT><FONT face=Arial
size=2>'</FONT><FONT face=Arial size=2>s stopping me is that many of the
precedent letters have code of their</FONT><FONT face=Arial size=2> own.
Somewhere in the loop below, I need to prevent any code in the Open event of
t</FONT><FONT face=Arial size=2>he document from running.</FONT></P>
<P align=left><FONT face=Arial size=2>If Application.FileSearch.Execute > 0
Then</FONT></P>
<P align=left><FONT face=Arial size=2> For i = 1 To
Application.FileSearch.FoundFiles.Count</FONT></P>
<P align=left><FONT face=Arial
size=2> </FONT> <FONT face=Arial
size=2>strN</FONT><FONT face=Arial size=2>ame =
Application.FileSearch.FoundFiles(i)</FONT></P>
<P align=left><FONT face=Arial
size=2> Set</FONT> <FONT face=Arial
size=2>objD</FONT><FONT face=Arial size=2>oc =
wrdapp.Documents.Open(</FONT><FONT face=Arial size=2>strN</FONT><FONT
face=Arial size=2>ame)</FONT></P>
<P align=left><FONT face=Arial
size=2> If</FONT> <FONT face=Arial
size=2>objD</FONT><FONT face=Arial size=2>oc.ReadOnly = False Then</FONT></P>
<P align=left><FONT face=Arial
size=2> Set
myRange =</FONT> <FONT face=Arial size=2>objD</FONT><FONT face=Arial
size=2>oc.Content</FONT></P>
<P align=left><FONT face=Arial
size=2>
myRange.Find.Execute FindText:=strFindText, Forward:=True</FONT></P>
<P align=left><FONT face=Arial
size=2>
myRange.InsertAfter strTestText</FONT></P>
<P align=left><FONT face=Arial
size=2> End If</FONT></P>
<P align=left><FONT face=Arial
size=2> doc.Close</FONT></P>
<P align=left><FONT face=Arial size=2> Next i</FONT></P>
<P align=left><FONT face=Arial size=2>The procedures I need to kaibosh all
have the same name: Document_Open</FONT><FONT face=Arial size=2>
(obviously)</FONT><FONT face=Arial size=2>, if that helps.</FONT><FONT
face=Arial size=2> How can I get my code to bypass those
procedures??</FONT></P>
<P align=left><FONT face=Arial size=2>Yours hopefully</FONT></P>
<P align=left><FONT face=Arial size=2>Roz</FONT></P></BLOCKQUOTE></BODY></HTML>