[AccessD] OT: Word VBA - skip code?

Marcus, Scott (GEAE, Contractor) scott.marcus at ae.ge.com
Wed Jul 23 06:26:15 CDT 2003


Pieter,

According to the Microsoft Help file, Macros are disabled if you don't use a
digital signature and High security settings. If a digital signature is
used, that implies a trusted source which also (in theory) means that the
macro could be trusted. Hence it is run. In Word, code and Macros are (for
this purpose) the same thing.

Scott

-----Original Message-----
From: Pieter Janssens [mailto:pieter.janssens.lists at pandora.be]
Sent: Tuesday, July 22, 2003 6:18 PM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] OT: Word VBA - skip code?


the code will still execute even if you use digital signature, because
you're opening them in code.

use

wordbasic.disableautomacros 1 to disable them, 0 to reenable.

greetings, pieter.


-----Original Message-----
From: Roz Clarke
Subject: RE: [AccessD] OT: Word VBA - skip code?

Thanks Scott, and sorry for calling you Marcus in my email to Charles :/
 
I will try both your suggestions in the morning.
 
Roz
 
-----Original Message-----
From: Marcus, Scott (GEAE, Contractor)
Subject: RE: [AccessD] OT: Word VBA - skip code?
 
Just read this in the help file....
 
Security levels in Word
Microsoft Word offers the following levels of security to reduce the chances
that macro viruses will infect your documents, templates, or add-ins: 
.         High   You can run only macros that have been digitally signed 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.
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).
 
Scott
-----Original Message-----
From: Roz Clarke 
Subject: [AccessD] OT: Word VBA - skip code?

Hello everyone
Another nasty problem for you. J
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

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list