Tuesday, July 25, 2006

allow word document to open mail merge with automation

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
View products that this article applies to.
function loadTOCNode(){}
Article ID
:
825765
Last Review
:
March 23, 2006
Revision
:
4.0
Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:
256986 (http://support.microsoft.com/kb/256986/) Description of the Microsoft Windows registryImportant This article contains information that shows you how to help lower security settings or how to turn off security features on a computer. You can make these changes to work around a specific problem. Before you make these changes, we recommend that you evaluate the risks that are associated with implementing this workaround in your particular environment. If you implement this workaround, take any appropriate additional steps to help protect your system.
On This Page
SYMPTOMS
CAUSE
WORKAROUND
Microsoft Office Word 2003
Microsoft Word 2002 Service Pack 3
STATUS
var sectionFilter = "type != 'notice' && type != 'securedata' && type != 'querywords'";
var tocArrow = "/library/images/support/kbgraphics/public/en-us/downarrow.gif";
var depthLimit = 10;
var depth3Limit = 10;
var depth4Limit = 5;
var depth5Limit = 3;
var tocEntryMinimum = 1;

.toc{display: none;}
SYMPTOMS
loadTOCNode(1, 'symptoms');
When you use Microsoft Office 2003 or Microsoft Office XP Service Pack 3 and open a mail merge main document, you experience one of the following symptoms:

You receive the following prompt:
Opening this will run the following SQL command:SELECT * FROM your datasourceData from your database will be placed in the document. Do you want to continue?Note If you click Yes, the mail merge main document opens with the data source attached. If you click No, the mail merge main document opens without the data source attached.

A mail merge main document that is opened by using VBA does not have the data source attached.Note It could be that you are using a program, for example Microsoft Access or Microsoft Visual FoxPro, to programmatically open a mail merge main document file when you experience the symptoms in this article.

Back to the top
CAUSE
loadTOCNode(1, 'cause');
The prompt that is described in the "Symptoms" section is by design. This prompt exists in all versions of Office 2003 and was introduced in Office XP with Office XP Service Pack 3. This prompt was added in the products listed in the "Applies to" section to make mail merge more secure. If you click Yes when you receive the prompt, you let code to run on your computer. A malicious user may be able to craft a SQL query that is designed to steal or to destroy data that you have access to. If you click No when you receive the prompt, you do not let code to run. Note Setting DisplayAlerts=none through VBA suppresses the prompt when the file is opened by using VBA, but uses the NO option to open the document and no data is attached to the mail merge main document.

Back to the top
WORKAROUND
loadTOCNode(1, 'workaround');
Warning This workaround may make your computer or your network more vulnerable to attack by malicious users or by malicious software such as viruses. We do not recommend this workaround but are providing this information so that you can implement this workaround at your own discretion. Use this workaround at your own risk.Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.If you read and understand the disclaimers that are provided in this article and if the documents that you open by using mail merge are from a trusted source, you may want to work around the behavior that is described in the “Symptoms” section.To work around this behavior, disable the security prompt by using the SQLSecurityCheck registry key. To disable the security prompt by using the SQLSecurityCheck registry key, follow the appropriate steps for your version of Microsoft Word.

Back to the top
Microsoft Office Word 2003
loadTOCNode(2, 'workaround');
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\Options "SQLSecurityCheck"=dword:00000000
1.
Start Registry Editor.
2.
Locate and then click the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\Options
3.
Click Edit, point to New, and then click DWORD Value.
4.
Under Name, type:
SQLSecurityCheck
5.
Double-click SQLSecurityCheck.
6.
In the Value data box, type:
00000000
7.
Click OK.

Back to the top
Microsoft Word 2002 Service Pack 3
loadTOCNode(2, 'workaround');
HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Word\Options"SQLSecurityCheck"=dword:00000000To do this, follow these steps:
1.
Start Registry Editor.
2.
Locate and then click the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Word\Options
3.
Click Edit, point to New, and then click DWORD Value.
4.
Under Name, type:
SQLSecurityCheck
5.
Double-click SQLSecurityCheck.
6.
In the Value data box, type:
00000000
7.
Click OK.

Back to the top

0 Comments:

Post a Comment

<< Home