[AccessD] OT: Word VBA - skip code?

Marcus, Scott (GEAE, Contractor) scott.marcus at ae.ge.com
Tue Jul 22 08:55:43 CDT 2003


I've heard that holding the <SHIFT> key will bypass the event. You just need
to figure out how to automate holding the key in code...
 
Scott

-----Original Message-----
From: Roz Clarke [mailto:roz.clarke at donnslaw.co.uk]
Sent: Tuesday, July 22, 2003 9:21 AM
To: AccessD (AccessD at databaseadvisors.com)
Subject: [AccessD] OT: Word VBA - skip code?



Hello everyone

Another nasty problem for you. :-)

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.

What's stopping me is that many of the precedent letters have code of their
own. Somewhere in the loop below, I need to prevent any code in the Open
event of the document from running.

If Application.FileSearch.Execute > 0 Then

 For i = 1 To Application.FileSearch.FoundFiles.Count

        strName = Application.FileSearch.FoundFiles(i)

        Set objDoc = wrdapp.Documents.Open(strName)

        If objDoc.ReadOnly = False Then

            Set myRange = objDoc.Content

            myRange.Find.Execute FindText:=strFindText, Forward:=True

            myRange.InsertAfter strTestText

        End If

        doc.Close

 Next i

The procedures I need to kaibosh all have the same name: Document_Open
(obviously), if that helps. How can I get my code to bypass those
procedures??

Yours hopefully

Roz

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030722/ede41963/attachment-0001.html>


More information about the AccessD mailing list