WD2000: ConfirmConversions Property in Macro Changes "Confirm Conversion at Open" Option (280741)
The information in this article applies to:
This article was previously published under Q280741 SYMPTOMS
When you use the ConfirmConversions property in a Visual Basic for Applications macro, the command may change the setting of the Confirm conversion at Open option.
For example, if the Confirm conversion at Open option is turned on (selected), and you run the following example macro code
Sub MyDocumentOpenMacro()
Documents.Open "C:\My Documents\Address.txt", ConfirmConversions:=False
End Sub
the ConfirmConversions property turns the Confirm conversion at Open option off (clears the check box).
As a result, when you open documents (on the File menu, click Open) that are not in the Word Document format, Word does not prompt you to select which converter to use to open the document.
WORKAROUNDMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
For more information about how to use the sample code in this article, click
the article number below to view the article in the Microsoft Knowledge
Base:
212536
OFF2000: How to Run Sample Code from Knowledge Base Articles
To work around this problem, store the condition of the Confirm conversion at Open option before you open your file in Word, and then reset the option back to its original setting after your macro opens your file.
Sub MyDocumentOpenMacro()
Dim x As Boolean
' Set x equal to the current setting of the Confirm conversion at Open
' option before opening your file.
x = Application.Options.ConfirmConversions
' Open your file.
Documents.Open "C:\My Documents\Address.txt", ConfirmConversions:=False
' Use the previously saved variable x to reset the Confirm conversion
' at Open option back to its setting (value of x) before opening your
' file.
Application.Options.ConfirmConversions = x
End Sub
For more information about the ConfirmConversions property, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type confirmconversions in the Office Assistant or the Answer Wizard, and then click Search to view the topic. STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. MORE INFORMATION
The Confirm conversion at Open option is a global setting in Word that applies to all documents that you open. If you want to manually select which converter that Word uses to open a file, click to select this option. If you want Word to select the correct converter automatically and open the document, click to clear this option.
To change the setting of the Confirm conversion at Open option, click Options on the Tools menu. Then click to select the General tab.
REFERENCESFor additional information about available resources for creating custom solutions using Visual Basic for Applications and Microsoft Word 2000, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
212623 WD2000: Macro Programming Resources
226118 OFF2000: Programming Resources for Visual Basic for Applications
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbbug kbmacroexample kbnofix KB280741 |
---|
|