#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. |
#2
|
|||
|
|||
Nothing is wrong with the Security Center.
Normal.dotm is not a document template. It is a global template that is required for Word to work correctly. If Word cannot find Normal.dotm at startup it will create a new one. It is a special case and different rules apply than to other templates. For code in a document template to run the folder in which it is located must be a trusted location, which you can set in the Trusted Locations tab of the Trust Center. FYI - this forum is not affiliated with Microsoft. There are no Microsoft people here. |
#3
|
|||
|
|||
I don't think you've red my initial posting OR the many postings where people are frustrated on how to deal with all the checkmarks in the "Secrity center" !
I use the folder for user templates - the same folder as the normal.dotm is placed ! I take a COPY of the normal.dotm to use as my special template - in the same folder - normal.dotm works but my special template DON'T ! The user template folder IS defined as a safe place in the "Security center" ! So please explane why it still blocks macros. I know the forum is not a part of the MS organisation but I hope some MS-people are looking for what's cooking here and there - I've have experienced that before - that's why I wrote as I did. Last edited by ksor; 07-17-2023 at 04:40 AM. |
#4
|
|||
|
|||
@Italophile
No, explanaton ? |
|
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 |