Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-29-2016, 07:44 AM
ch1325 ch1325 is offline Using a display alert command in Word Windows 7 64bit Using a display alert command in Word Office 2013
Novice
Using a display alert command in Word
 
Join Date: Jun 2015
Location: Montana
Posts: 12
ch1325 is on a distinguished road
Default Using a display alert command in Word


Hi,

Code:
Sub Display()
Application.DisplayAlerts = wdAlertsNone
End Sub
Whenever I try using this code within a document on a shared drive it does not work anymore, I still get a SQL alert when I open the document.

Using it on my drive has no problems.
Reply With Quote
  #2  
Old 04-29-2016, 04:18 PM
macropod's Avatar
macropod macropod is offline Using a display alert command in Word Windows 7 64bit Using a display alert command in Word Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The only reason you'd get an SQL prompt is if the document is configured for a mailmerge. Setting Application.DisplayAlerts = wdAlertsNone not only eliminates the prompt but also destroys the mailmerge functionality. Ordinarily, that would therefore only be done when Word is being automated from another application that has its own copy of the SQL code and the automation restores DisplayAlerts when it's done. There is a registry patch for suppressing SQL prompts that does not destroy a mailmerge main document's functionality.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 04-30-2016, 06:50 AM
gmayor's Avatar
gmayor gmayor is offline Using a display alert command in Word Windows 10 Using a display alert command in Word Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

There's a macro process at http://www.gmayor.com/word_vba_examples.htm which will toggle the SQL message suppression setting in the registry.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a display alert command in Word How to run command in word si14 Word 3 06-10-2015 04:08 PM
Using a display alert command in Word How to dismiss/avoid warning/alert dialog boxes in Microsoft.Office.Interop.Word.Document meenagrace Word VBA 3 11-07-2014 01:29 PM
From the command line, how do I run a Word macro? jdockstader Word 7 02-04-2013 06:09 AM
Using a display alert command in Word Word VBA: How to create a command button and trigger a function? tinfanide Word VBA 2 12-02-2011 05:51 AM
Invoking a command line from inside Word bolpom Word 1 03-16-2011 03:03 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft