Article ID: 237338 - Last Review: June 17, 2005 - Revision: 2.0 WD2000: Error Message Using WordMail: "This method or property is not available"This article was previously published under Q237338 On This PageSYMPTOMS
When you are using Microsoft Word to edit e-mail messages (in Microsoft Outlook 2000, on the Tools menu, click Options and then click the Mail Format tab) and you try to automate Word from another program, you may encounter problems processing some Word commands. For example, you may receive Automation errors such as "This method or property is not available" or other errors. This article describes how to check whether WordMail is running when using Automation to automate Word from another program. CAUSE
This problem can occur when all of the following conditions are true:
For example, the following Visual Basic for Applications code sample may cause the following error message:
Run-time error '4605': "The Open method or property is not available
RESOLUTIONMicrosoft 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.
To determine whether the focus is in a WordMail message, use the Selection.Information property together with the FocusInMailHeader property to determine whether a WordMail instance or a Word instance has the focus. FocusInMailHeader PropertyThe FocusInMailHeader property returns True if the insertion point is in a WordMail header field (the To field, for example).Selection.Information PropertyUse the Selection.Information property to return information about the specified or current selection.The syntax of the Selection.Information property is
Selection.Information(Type) where Type is a constant specifying the information to return. Use wdInWordMail as the Type constant to return a value that indicates the WordMail location of the selection, as shown in the following table: Value WordMail Location ----------------------------- 0(zero) The selection or range isn't in a WordMail message. 1 The selection or range is in a WordMail send note. 2 The selection or range is in a WordMail read note. ExampleThe following sample code demonstrates how to use these properties to determine whether WordMail or Word has the current focus:For more information about FocusInMailHeader property, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type FocusInMailHeader property in the Office Assistant or the Answer Wizard, and then click Search to view the topic. For more information about GetObject Function, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type GetObject Function in the Office Assistant or the Answer Wizard, and then click Search to view the topic. REFERENCESFor additional information about using automation with Word, click the article number below
to view the article in the Microsoft Knowledge Base:
237337
(http://support.microsoft.com/kb/237337/EN-US/
)
OFF2000: How to Use (OLE) Automation with Word
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
(http://support.microsoft.com/kb/212536/EN-US/
)
OFF2000: How to Run Sample Code from Knowledge Base Articles
| Article Translations
|
Back to the top
