#1
|
|||
|
|||
"Security center" NOT working or messed up !!!
I have an Access application creating some Word documents.
I want these documents (created via my Access application) based on a special template - let's call it "AccWrdTemplate.dotm". I have the template stored side by side the Normal.dotm in the folder "C:\Users\kelds\AppData\Roaming\Microsoft\Template s" It works nicely when I use the Normal.dotm template but NOT when I use AccWrdTemplate.dotm - macros is blocked ... in fact my special template is just to a start a COPY of the Normal.dotm ! Why is the FILE NAME so cardinal here - that's the ONLY difference ! Here are the code I use: Code:
Set WRDobj = CreateObject("Word.Application") ' WRDobj.Visible = False Set Doc = WRDobj.Documents.add(Environ("SlgtSysWordSkabelon")) Doc.Sections(1).Headers(wdHeaderFooterPrimary).Range.Text = "NotatID: " & Me.NotatID.Value & "-" & Me.Benævnelse.Value Doc.SaveAs Environ("SlægtHovedmappe") & "\" & "NOTAT_docs\" & Me.Sti_til_fil.Text, wdFormatDocumentDefault WRDobj.Quit Set Doc = Nothing Set WRDobj = Nothing Maybe I should say that the 'shift' from Normal.dotm to AccWrdTemplate.dotm is done by changing the enviroment variable "SlgtSysWordSkabelon" - so no code is changed no storage is changed ONLY the file name is changing - Normal.dotm is OK, but AccWrdTemplate.dotm is NOT - it block for macros ! If I 2-click the dotm file it works nicely in BOTH cases - no warning of blocked macros !!! Now comes the FUN PART: If I store my special template in a special folder AND give it the file name Normal.dotm ... then NO warning of blocked macros comes up ! OH, NO ... something else fooled me here ! HALLOOOOO MS people if you are here - do something about this problem or tell me what I do wrong !! Last edited by ksor; 07-16-2023 at 03:28 AM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
The "Security center" settings ??? | ksor | Word VBA | 2 | 07-15-2023 08:34 AM |
Excel 2003: VBA "Function" causes "#VALUE!" errors after running "insert/delete row" custom macro | Matt C | Excel Programming | 2 | 01-08-2022 06:03 AM |
Security problem? "This macro can't be found or is disabled." | gregrivet | Word | 5 | 07-13-2020 06:52 AM |
Using Word is impossible as a box headed "Windows Security" keeps popping up | Hambagashle | Word | 1 | 07-29-2014 04:31 AM |
How to choose a "List" for certain "Heading" from "Modify" tool? | Jamal NUMAN | Word | 2 | 07-03-2011 03:11 AM |