3.66 Message

Base class containing methods and properties common to items that may be sent to a user.

3.66.1 Properties

The following table lists properties along with their access and descriptions.

Property

Access

Description

Application

R/O

Application. The Application object.

Attachments

R/O

Attachments collection. The collection of attachments to this message.

BodyText

R/O

FormattedText. The body text of this message. The message body field has a limit of 32,000 characters.

BoxType

R/O

Enum (MessageBoxTypeConstants). The box type of this message.

ClassName

R/O

String. GroupWise names its messages with the following default class names:

  • GW.MESSAGE.APPOINTMENT
  • GW.MESSAGE.DOCUMENTREFERENCE
  • GW.MESSAGE.MAIL
  • GW.MESSAGE.NOTE
  • GW.MESSAGE.PHONE
  • GW.MESSAGE.TASK

Custom 3rd-Party Object (C3PO) servers can further subtype these names by appending further classifications. For example, A C3PO might create GW.MESSAGE.TASK.PROJECTX.

ConvertAttachments

R/W

Boolean. TRUE if we can convert the attachments.

CreationDate

R/O

Date. The date and time this message was created.

Deleted

R/O

Boolean. TRUE if this message has been deleted (is in the Trash). A message can be simultaneously in the Trash and in other folders.

DownloadStatus

R/O

DownloadStatus. Provides information about the message parts that have been downloaded. When the account containing the message is not a remote account, this property is still available and always indicates that everything has been downloaded.

EnclosingFolders

R/O

Folders collection. Returns the folder this item is contained in.

ExpandedRecipients

R/O

Recipients collection. This property returns an expanded set of recipients for the message. The expanded set is the set of recipients associated with the message once all groups have been expanded. For draft messages, expansion of the groups occurs when this property is accessed. For InBox or OutBox messages, the groups were expanded when the message was originally sent.

The returned collection may not contain every recipient of the message. If a message is sent to a system group on a foreign domain, GroupWise is unable to track the list of users. The foreign group will not be expanded.

This collection is informational only. Adding a recipient to the collection does not cause the message to be sent to that recipient. Use the Recipients property for addressing a message.

Fields

R/O

Fields collection. The collection of fields for this message.

FromText

R/W

String. The text provided in the From field for the message. The content defaults to the full name of the sender. If the From text is modified, the user’s full name (in parentheses) is always appended to the text.

Hidden

R/W

Boolean. TRUE if this message is hidden. If this message is hidden, it will not show up in any User Interface (UI).

MasterRevisionNumber

R/O

Long. The revision number of the message when the message was downloaded in remote.

MessageID

R/O

String. A unique, persistent (valid across sessions) ID for this message.

ModifiedDate

R/O

Date. The date and time this message was last modified.

NotifyWhenDeleted

R/W

Enum (NotifyMessageConstants). Specifies the type of notification to send when this message has been deleted.

NotifyWhenOpened

R/W

Enum (NotifyMessageConstants). Specifies the type of notification to send when this message has been opened.

Opened

R/W

Boolean. TRUE if this message has been opened. Attempting to set this property to FALSE would be a violation of GroupWise security, so that is not allowed. Setting this property to TRUE does not affect the value of the Read property.

Parent

R/O

Account. A reference to the Account object. A message can exist in more than one folder, so there is no natural parent.

Priority

R/W

Enum (MessagePriorityConstants). The priority of this message

Private

R/W

Boolean. TRUE if this message is private (i.e. a proxy user cannot see this message).

Read

R/W

Boolean. TRUE if this message has been read.

Recipients

R/O

Recipients collection. The collection of users and groups to whom this message is sent.

ReplyChildren

R/O

MessageList. The list of messages that are next in line in a reply thread.

ReplyDaysRequested

R/W

Long. The number of days within which a reply is requested.

ReplyParent

R/O

Message. The message before this message in the reply thread.

ReplyRequested

R/W

Enum (ReplyRequestedConstants). Specifies if and when a reply is requested.

ReplyRoot

R/O

Message. The first message in a reply thread.

RevisionNumber

R/O

Long. The number of times this message has been revised.

Routed

R/W

Boolean. TRUE if this message has been routed.

RoutingEndOfLine

R/O

Boolean. TRUE if this message has reached the last user in the routing list.

Sender

R/O

Address. The user who sent this message.

Subject

R/O

FormattedText. The subject of this message.

ViewName

R/W

String. The name of the view associated with this message.

3.66.2 Methods

Annotate(Note Note)

Adds an existing personal Note object as an attachment to this message. Works even if this message has been sent, because the Note is personal. See also the Add method in the Attachment object.

  • Annotating an item requires create and modify rights to the folder that contains the item.

  • Annotating encapsulated items is not allowed because no distinct containing folders exist for such an item.

  • Annotations can be edited only by the user who originally created the annotation (subject also to folder rights). For example, an annotation created on an item in a shared folder can only be edited by the user who created the annotation.

Message Clone()

Makes an independent copy of this message and returns it as a new draft message. The new message is contained in the same folders as the original.

Delete()

Removes a message from folders and puts it in the Trash. There will be one Trash entry for each folder that contained the message. Deleting a message places the message into the owner’s trash. This can be somewhat confusing when deleting messages from a shared folder. The message is placed in the owner’s trash and not necessarily into the trash of the account that made the delete call.

Mail Forward()

Forwards this message. Returns a new draft Mail object with this Message object included as an attachment. The new message is contained in the same folders as the original.

Refresh()

Forces this message and associated objects and collections to reread property values from the message database. The actual reading of a specific property may be postponed until the next time the property is accessed. This "lazy evaluation" is an optimization that avoids unnecessary reading of unaccessed properties. If the message is an attachment, it is refreshed when its associated Attachment object is refreshed.

Message Reply([String ClassName], [Boolean ReplyToAll], [Boolean IncludeSenderMessageText], [Boolean AttachOriginalMessage])

Creates a reply message. Returns a new draft Message object item with the message sender as recipient.

  • ClassName specifies the kind of message to create. If ClassName is omitted, GW.MESSAGE.MAIL is assumed.

  • If ReplyToAll is set to TRUE, all recipients of this message, except the current user, will be included as recipients in the reply message.

  • If IncludeSenderMessageText is set to TRUE, includes this message's BodyText in the reply message’s BodyText.

  • If AttachOriginalMessage is set to TRUE, attaches this message to the reply message.

Any omitted Boolean parameters are defaulted to FALSE. The reply message is contained in the same folders as the original. The reply message is not automatically linked to the Work In Progress folder (unless the original message was linked there).

Retract()

Requests message retraction from recipient mailboxes. The message's BoxType must be egwOutgoing.

Message Send()

Returns the OutBox message after this message is sent. This method will delete the draft message to be deleted. When recipients fail to resolve, this method will throw an exception. This method does not update the Frequent Contacts address book. This should be done manually by the caller of the method.

3.66.3 Procedures

To move a message between folders, move it from the old folder's Messages collection to the new folder's Messages collection.

To move a message to the Trash, delete it from the folder's Messages Collection.

To undelete a Trash message, add it back to its old Messages collection.

To link a message to folders, add it to the Messages Collections of the desired folders.

To unlink a message from a folder, delete it from the folder's Messages Collection.

To empty a message from the Trash, delete the TrashEntry object.

To empty the Trash, use the Trash object's Empty method.

3.66.4 Remarks

When folder A and folder B contain a message, the message's EnclosingFolders property includes A and B. The Messages collections of folders A and B contain the message. When the message moves from A to the Trash, the message's Deleted property is TRUE, and its EnclosingFolders property contains only folder B. When the message moves from B to the Trash, its Deleted property remains TRUE, and its EnclosingFolders property contains nothing

When a Message object is refreshed, it recursively refreshes its Attachments collection, the FormattedText objects returned by its BodyText and Subject properties, its Fields collection, its Recipients collection, and the Address object returned by its Sender property. It also updates Message objects returned by its ReplyChildren, ReplyParent, and ReplyRoot properties, but it does not recursively refresh those messages. Specific subtypes of the Message object may recursively refresh some of their own properties.