目录

Item 属性

优质
小牛编辑
121浏览
2023-12-01

全部显示

Item 属性应用于 FileTypes 集合的情形。

返回一个数值,指出 FileSearch 对象的 Execute 方法将搜索的文件类型。MsoFileType 类型,只读。

MsoFileType 可以为下列 MsoFileType 常量之一。msoFileTypeAllFilesmsoFileTypeBindersmsoFileTypeCalendarItemmsoFileTypeContactItemmsoFileTypeDatabasesmsoFileTypeDataConnectionFilesmsoFileTypeDesignerFilesmsoFileTypeDocumentImagingFilesmsoFileTypeExcelWorkbooksmsoFileTypeJournalItemmsoFileTypeMailItemmsoFileTypeNoteItemmsoFileTypeOfficeFilesmsoFileTypeOutlookItemsmsoFileTypePhotoDrawFilesmsoFileTypePowerPointPresentationsmsoFileTypeProjectFilesmsoFileTypePublisherFilesmsoFileTypeTaskItemmsoFileTypeTemplatesmsoFileTypeVisioFilesmsoFileTypeWebPagesmsoFileTypeWordDocuments

expression.Item(Index)

expression 必需。该表达式返回一个 FileTypes 集合。

IndexLong 类型,必需。要返回的对象索引号。

Item 属性应用于 CommandBars 对象的情形。

返回 CommandBars 集合中的 CommandBar 对象。

expression.Item(Index)

expression 必需。该表达式返回一个 CommandBars 对象。

IndexVariant 类型,必需。要返回的对象名称或索引号。

Item 属性应用于 CommandBarControls 对象的情形。

返回 CommandBarControls 集合中的 CommandBarControl 对象。

expression.Item(Index)

expression 必需。该表达式返回一个 CommandBarControls 对象。

IndexVariant 类型,必需。要返回的对象名称或索引号。

Item 属性应用于 DocumentProperties 对象的情形。

返回 DocumentProperties 集合中的 DocumentProperty 对象。

expression.Item(Index)

expression 必需。该表达式返回一个 DocumentProperties 对象。

IndexVariant 类型,必需。要返回的文档属性名称或索引号。

Item 属性应用于 BalloonCheckboxesBalloonLabels 对象的情形。

返回 BalloonCheckBoxBalloonLabel 对象。

expression.Item(Index)

expression 必需。该表达式返回上面对象之一。

IndexLong 类型,必需。要返回的复选框或标签的索引号。

Item 属性应用于 MsoEnvelope 对象的情形。

返回可用于将文档以电子邮件发送的 MailItem 对象。

expression.Item

expression 必需。该表达式返回一个 MsoEnvelope 对象。

Item 属性应用于 PropertyTests 对象的情形。

返回 PropertyTests 集合中的 PropertyTest 对象。

expression.Item(Index)

expression 必需。该表达式返回一个 PropertyTests 对象。

IndexLong 类型,必需。要返回的属性测试的索引号。

Item 属性应用于 ScopeFoldersSearchFolders 对象的情形。

返回一个表示父对象的子文件夹的 ScopeFolder 对象。

expression.Item(Index)

expression 必需。该表达式返回上面对象之一。

IndexLong 类型,必需。确定要返回的子文件夹。

Item 属性应用于 SearchScopes 对象的情形。

返回一个 SearchScope 对象,对应于执行文件搜索的区域,例如本地驱动器或 Microsoft Outlook 文件夹。

expression.Item(Index)

expression 必需。该表达式返回一个 SearchScopes 对象。

IndexLong 类型,必需。确定要返回的 SearchScope 对象。

Item 属性应用于 SignatureSet 对象的情形。

返回一个 Signature 对象,对应于文档当前使用的数字签名。

expression.Item(iSig)

expression 必需。该表达式返回一个 SignatureSet 对象。

iSigLong 类型,必需。确定要返回的 Signature 对象。

Item 属性应用于 AnswerWizardFilesFoundFiles 对象的情形。

分别从 AnswerWizardFiles 集合中返回文件名字符串,或从 FoundFiles 对象表示的文件名列表中返回文件名。String 类型,只读。

expression.Item(Index)

expression 必需。该表达式返回上面对象之一。

IndexLong 类型,必需。要返回的“应答向导”文件名字符串或文件名的索引号。

Item 属性应用于 AssistantBalloonCheckboxBalloonLabelFileDialog 对象的情形。

返回对象相关的文本。String 类型,只读。

expression.Item

expression 必需。该表达式返回上面对象之一。

Item 属性应用于 WebPageFonts 对象的情形。

返回 WebPageFonts 集合中特定 MsoCharacterSet 值的 WebPageFont 对象。

expression.Item(Index)

expression 必需。该表达式返回上面对象之一。

IndexMsoCharacterSet 类型,必需。指定的字符集。

MsoCharacterSet 可以为下列 MsoCharacterSet 常量之一。msoCharacterSetArabicmsoCharacterSetCyrillicmsoCharacterSetEnglishWesternEuropeanOtherLatinScriptmsoCharacterSetGreekmsoCharacterSetHebrewmsoCharacterSetJapanesemsoCharacterSetKoreanmsoCharacterSetMultilingualUnicodemsoCharacterSetSimplifiedChinesemsoCharacterSetThaimsoCharacterSetTraditionalChinesemsoCharacterSetVietnamese

示例

应用于 CommandBars 对象的情形。

Item 为对象或集合的默认成员。下面两个语句均将CommandBar 对象指定给 cmdBar

Set cmdBar = CommandBars.Item("Standard")
Set cmdBar = CommandBars("Standard")

应用于 BalloonCheckboxesBalloonLabels 对象的情形。

Item 为对象或集合的默认成员。下面两个语句均将指定给 myBalloonBalloon 对象中的第一个标签的文本指定给 lblText

lblText = myBalloon.Labels(1).Item
lblText = myBalloon.Labels(1)

应用于 AnswerWizardFilesFoundFiles 对象的情形。

本示例重置当前“应答向导”的文件列表,并在消息框中显示文件数量和文件名,使用 Item 属性返回文件名。

Dim customAnswerWizard As AnswerWizard
Dim strFileList As String
Dim intCounter As Integer
Dim intNumFiles As Integer
Set customAnswerWizard = Application.AnswerWizard
intCounter = 1

customAnswerWizard.ResetFileList
strFileList = ""
intNumFiles = customAnswerWizard.Files.Count
For intCounter = 1 To (intNumFiles)
 strFileList = strFileList & _
 customAnswerWizard.Files.Item(intCounter) & Chr(13)
Next

MsgBox "There are " & customAnswerWizard.Files.Count & _
 " files avaialble through this AnswerWizard: " & _
 Chr(13) & strFileList

应用于 WebPageFonts 对象的情形。

本示例在活动应用程序中使用 Item 属性将 myFont 设置为应用 English/Western European/Other Latin Script 字符集的 WebPageFont 对象。

Dim myFont As WebPageFont
Set myFont = _
 Application.DefaultWebOptions.Fonts. _
 Item(msoCharacterSetEnglishWesternEuropeanOtherLatinScript)

应用于 MsoEnvelope 对象的情形。

本示例将活动的 Microsoft Word 文档以电子邮件发送到传递给子例程的电子邮件地址。

Sub SendMail(ByVal strRecipient As String)

    'Use a With...End With block to reference the msoEnvelope object.
    With Application.ActiveDocument.MailEnvelope

        'Add some introductory text before the body of the e-mail message.
        .Introduction = "Please read this and send me your comments."

        'Return a MailItem object that you can use to send the document.
        With .Item

            'All of the mail item settings are saved with the document.
            'When you add a recipient to the Recipients collection
            'or change other properties these settings will persist.

            .Recipients.Add strRecipient
            .Subject = "Here is the document."

            'The body of this message will be
            'the content of the active document.
            .Send
        End With
    End With
End Sub