/ Forums / Advansys Formativ / Creating Solutions with Formativ / How do I create a new Phone message? / Reply To: How do I create a new Phone message?

#6396
Support 2
Moderator

The following applet code should assist. Please let me know if you have any further questions.

Regards,

Advansys Support

code:


'-------------------------------------------------------------------------------
' Create a New Phone Message
'
' The following example creates a new phone message without any user
' interface. You would normally use this approach when you have all the information
' required to create a new item, and there is no need for user interaction.
'-------------------------------------------------------------------------------

Sub Main(Client, GWEvent)

Dim objPhone
Dim objNewPhone
Dim objRecipient

' Create a draft phone message with no user interface
Set objPhone = GroupWise.Account.Calendar.Messages.Add("GW.MESSAGE.PHONE", fgwDraft)

' Add a single recipient - ourself
Set objRecipient = objPhone.Recipients.Add(GroupWise.Account.Owner.EmailAddress,,0)
With objPhone
.FromText = "Formativ"
.Priority = fgwNormal
.CallerCompany = "Advansys"
.CallerName = "Mr Smith"
.CameToSee = TRUE
.PhoneNumber = "555 7777"
.PleaseCall = TRUE
.ReturnedCall = TRUE
.Telephoned = TRUE
.Urgent = TRUE
.WantsToSee = TRUE
.WillCall = TRUE
.Subject = "This phone message was created using Formativ"
.BodyText.PlainText = "This is the body text"
End With

Set objNewPhone = objPhone.Send

Call MsgBox ("Message Id : " & objNewPhone.MessageID, 64, "Formativ")

Set objRecipient = Nothing
Set objPhone = Nothing

End Sub