共用方式為


Attachment.Position Property

Returns or sets an Integer (int in C#) value indicating the position of the attachment within the body of the item. Read/write.

Namespace:  Microsoft.Office.Interop.Outlook
Assembly:  Microsoft.Office.Interop.Outlook (in Microsoft.Office.Interop.Outlook.dll)

Syntax

'Declaration
<DispIdAttribute()> _
Property Position As Integer
    Get
    Set
'Usage
Dim instance As Attachment
Dim value As Integer

value = instance.Position

instance.Position = value
[DispIdAttribute()]
int Position { get; set; }

Property Value

Type: System.Int32

Remarks

The Position property only works on an attachment for an item where the body format is Rich Text (RTF). If the body format is not RTF, the Position property is ignored for a set operation and always returns zero (0) for a get operation.

If you set the Position property to 0 for an item where the body format is RTF, the attachment will be hidden in Outlook's user interface. The attachment is not visible in a view, and the user cannot remove the attachment from the body of the item. The attachment can still be accessed through the Attachments collection on the item.

The only item that allows programmatic setting of the BodyFormat property is a MailItem. Other item types such as Appointment, Contact, and Task are RTF by default.

See Also

Reference

Attachment Interface

Attachment Members

Microsoft.Office.Interop.Outlook Namespace