How to suppress a dialog box, shown below

Maxine Nietz 1 Reputation point
2024-10-10T18:35:50.56+00:00

Office 365. Have a word doc that is merged to a query in access, using the command:

MergeSingleWord "C:\Users\nevadamax\OneDrive\Documents\BudgetCorp\NewBudgetCorpDocs", True

Where MergeSingleWord is a procedure:

Public Function MergeSingleWord(Optional strDir As String = "NewBudgetCorpDocs", Optional bolFullPath As Boolean = False, Optional strOutPutDoc As String = "")

   Dim strOutFile       As String      ' temp csv merge text file name

   Dim frmF             As Form

   Dim strDirPath       As String      ' full path name to working dir

Set frmF = Screen.ActiveForm

frmF.Refresh

strDirPath = DirToPath(strDir, bolFullPath)

strOutFile = strDirPath & TextMerge

If MakeMergeText(frmF, strOutFile) Then

      DoCmd.OpenForm "GuiWordTemplate", , , , , , strDirPath & "~" & strOutPutDoc

End If

End Function

I keep getting the following dialog box:MergeError

HOW CAN I SUPPRESS THIS DIALOG BOX????

Word
Word
A family of Microsoft word processing software products for creating web, email, and print documents.
882 questions
Access
Access
A family of Microsoft relational database management systems designed for ease of use.
400 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jiajing Hua-MFST 10,645 Reputation points Microsoft Vendor
    2024-10-11T02:53:42.5333333+00:00

    Hi @Maxine Nietz

    Please refer to this article: You receive the "Opening this will run the following SQL command" message when you open a Word mail merge main document that is linked to a data source

    For newer versions of Office, add following key for a check:

    HKEY_USERS\SOFTWARE\Microsoft\Office\16.0\Word\Options

    Key name: SQLSecurityCheck

    Type: DWORD

    Data value: 0

    Please note, serious problems might occur if you modify the registry incorrectly. Before you modify it, please remember to back up the registry for restoration in case problems occur.

    Here is an article about how to back up and restore the registry in Windows: https://support.microsoft.com/en-us/kb/322756


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.