Results 1 to 3 of 3

How to Bypass Macro Security Warning Message in MS Word 2003 programmatically

Threaded View

sugaprasad How to Bypass Macro Security... 12-05-2012, 07:42 AM
JosephP Re: How to Bypass Macro... 12-05-2012, 08:27 AM
sugaprasad Re: How to Bypass Macro... 12-05-2012, 08:45 AM
  1. #1
    Forum Contributor
    Join Date
    11-29-2012
    Location
    Coimbatore, India
    MS-Off Ver
    Excel 2010
    Posts
    101

    How to Bypass Macro Security Warning Message in MS Word 2003 programmatically

    Hi Everyone,

    I'm developing a Excel Macro in 2003 format. This Macro will open a Word Document (Code Template_Modified_V3.doc - 2003 format) and update the fields in the word document and this work continues in a for loop. Inturn there is a Macro in the Word Document too. so each time I'm getting Security Warning Message in the Word Document whether to Disable or Enable the Macro. My company doesnt allow me to change the Security Level of the macro to Low. Neither it allows to sign the Macro with Digital Certificate.

    So I tried to add 'objWord.DisplayAlerts = False'. But this doesn't work

    Is there any other method to handle this Security warning programmatically??

    Please help. Thanks in Advance.

    Please note that I'm using MS Office 2003

    Code :

    Set objWord = CreateObject("Word.Application")
    
    objWord.Visible = True
    objWord.DisplayAlerts = False 'To Disable the security warning messaage
    
    ABC_Ouput_Path = "C:\New Folder\" 'Result Folder
    
    
    
    'runnning loop for each row in the input sheet
    For RowIndex = StartRow To EndRow 'Total rows in the input data sheet
    
        ABC_Name = "Code_Template" '& RowIndex 'you can use diffrent file name for each row
        ABC_Template_Path = "C:\Code Template_Modified_V3.doc"
        Set Doc = objWord.Documents.Open(ABC_Template_Path)
        
        sMedicalPlanCode = range.Cells(RowIndex, 1)
        sCOC = range.Cells(RowIndex, 3)
        sSegment = range.Cells(RowIndex, 4)
        sState = range.Cells(RowIndex, 5)
        sProduct = range.Cells(RowIndex, 8)
        sStart_Date = range.Cells(RowIndex, 225)
        sEnd_Date = range.Cells(RowIndex, 226)
        sSegment = range.Cells(RowIndex, 4)
        sCustomer_Service = range.Cells(RowIndex, 223)
        sDeductible = range.Cells(RowIndex, 227)
        sPlan = range.Cells(RowIndex, 224)
        
           
        
        'Read all values from the input sheet for a specific row
         objWord.Run "Driver", sEnd_Date, sStart_Date, sMedicalPlanCode, sState, sCOC, sSegment, sCustomer_Service, sDeductible, sProduct, sPlan        
        Doc.SaveAs ABC_Ouput_Path & ABC_Name & "_" & sMedicalPlanCode & ".doc"
        Doc.Close
    
    Next
    Last edited by sugaprasad; 12-05-2012 at 07:44 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1