Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I have a question regarding Macro security handling in Office (specifically in Word and Excel). We are writing Office add-ins that interacts with a Document Management System (DMS). I need to be able to predict whether Word (or Excel) is going to ask the user if wants to enable Macros. Sorry for the long post, but it takes a few lines to explain this. :-)
We have used the DocumentBeforeClose (for Word: Microsoft.Office.Interop.Word.ApplicationEvents4) event where we have written an event handler. Now, every time a user closes a document, given the document has been checked out from the DMS, we ask the user if he wants to check the document in again. This works perfect for most situations, except the following: • IF the document contains macros AND the macro settings is set to “Disable all macros with notification” (Trust Senter | Macro settings) AND the document is not located in a “Trusted location”, THEN Word will ask the user if he wants to enable macros. If the user ignores this question and continues working with the document, this is still not a problem. However, if the user choses to “Enable macros”, Word closes the document and reopens it (executing macros if applicable). This also fires the DocumentBeforeClose event, which eventually leads to displaying our question “The document is checked out to you, do you want to check in again?” which is of course inappropriate and not very elegant at this point, because the user is actually opening a document, not closing. This is the reason why we need to be able to predict WHY Word is closing the document, is it because the user closed the document or is it because Word forced a document close to reopen it with macros enabled. So, if there is a way to predict whether the document is closed for immediate reopening (which is the case if the user confirm that he want to enable macros), we could omit our re-check-in question. I’ve been looking into using the msoAtuomationSecurity enumerable, but it seems this is set to msoAutomationSecurityLow despite of the security settings in Word which is set to “Disable all macros with notification”. I have not been able to actually see the connection between the Macro Setting in Word and the value of msoAtuomationSecurity. An alternative solution to the problem could be to detect the Macro Setting in the Trust Center (if possible) and from that decide what to do. But I have not found any way of detecting these settings. Are they stored in registry? Anyone got a clue? Thank's in advance Last edited by dagarve : June 21st 12 at 11:36 AM |
#2
![]() |
|||
|
|||
![]()
Cho thuê âm thanh ánh sáng
Tổ chức lễ hội, sự kiện, ca nhạc, đám cưới, đám hỏi Cho thuê m*n sao giá rẻ, m*n hình led giá rẻ chất lượng tốt Cho thuê sân khấu ca nhạc, cho thuê đèn led pha, cho thuê loa kéo https://violetwedding.net/cho-thue-a...-anh-sang.html |
#3
![]() |
|||
|
|||
![]()
Cho thuê thiết bị b*n ghế Tiffany giá rẻ
Cho thuê nh* bạt, cổng sự kiện Cho thuê b*n ghế hội nghị đám cưới/ tổ chức sinh nh*t/ sự kiện Cho thuê b*n tròn, b*n ghế bar các loại Cho thuê v* nh*n may khăn b*n theo yêu cầu https://violetwedding.net/ghe-tiffany.html |
#4
![]() |
|||
|
|||
![]()
Cho thuê gian h*ng trưng b*y sản phẩm, gian h*ng triển lãm giới thiệu doanh nghiệp trong hội chợ
Cho thuê gian h*ng tố chức sự kiện, trụ inox v* trụ barie + vải dây nhung các loại Cho thuê h*ng r*o sắt di động trong các sự kiện, lễ hội https://violetwedding.net/cho-thue-g...-tru-inox.html |
#5
![]() |
|||
|
|||
![]()
Dịch vụ trang tr* b*n tiệc gallery cho các đám cưới hỏi sinh nh*t sự kiện theo yêu cầu tại nh* ở tphcm, giá rẻ trọn gói v* không phát sinh chi ph* khi s* dụng dịch vụ của Violet Wedding
https://violetwedding.net/trang-tri-...-dam-cuoi.html |
#6
![]() |
|||
|
|||
![]() |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Word Macro Security | Microsoft Word Help | |||
About Macro Security | Microsoft Word Help | |||
Macro Security ? | Microsoft Word Help | |||
Macro Security | Mailmerge | |||
Macro Security | Microsoft Word Help |