/ Forums / Advansys Formativ / Creating Solutions with Formativ / How do I create a new Phone message?
-
CreatorTopic
-
February 13, 2002 at 8:08 pm #3848
I need to create a new phone message, and can’t find any examples. What am I doing wrong?
======================================
Dim NewPhoneMsg
Set NewPhoneMsg = GroupWise.NewPhone
NewPhoneMsg.Subject = “Phone Message”
NewPhoneMsg.Date = Msg.Date
{blah, blah, blah}
NewPhoneMsg.Send -
CreatorTopic
-
AuthorReplies
-
February 13, 2002 at 9:35 pm #6396
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
February 14, 2002 at 5:17 am #6393Your code for the Phone Message works perfectly – thanks!
What I am doing here is an applet that when I receive a CallWare voicemail message in my inbox (comes in as regular email with a WAV file attachment), I would like to morph (“Change Item Type”) it into a Phone Message.
Since the message is sent to me, I imagine this can’t be done (only on ones I am sending will it work).
So, for now, I am readying the inbound message, and creating a new Phone Message, based on its properties, and then delete the original email.
Now I have a message in my inbox that is a Phone Message. It works, but is awkward (timestamp is different, “from” is different, etc).
Is there a way to Morph the messge? This would be cleaned code, and I wouldn’t have to deal with copying the file attachment from one message to another Ugh….
February 15, 2002 at 3:18 am #6394Unfortunately there is no way to morph the message without creating a new message, which means the time stamp will always be different and you need to process the attachment.
Instead of using the exact code in the example for the Phone message creation, you could modify it so that it creates a Posted Phone Message rather than a group phone message. You could then include the date/time stamp details of the original message in the body text of the phone message. As you pointed out, this is not ideal because a) you would still need to transfer the WAV attachment and b) the creation date of the message does not match the original.
As an aside, just for future reference, see the new AddExistingMessage command at http://developer.novell.com/ndk/doc/gwobjapi/index.html?gwobjenu/data/h7ikbsqg.html . We have not used this call yet as it was only documented last week. In any case this new call will not solve your current requirements. It allows the creation of a new message without actually sending it (incoming, outgoing, draft, personal), although it appears that this will only work with an email message type.
Regards,
Advansys Support
February 15, 2002 at 5:43 am #6391OK, I’ll proceed with creating a new message. I thought for a little bit that I could Clone the message, but it doesn’t appear that’s possible with a received message, just a new one.
On a sire note, the URL you passed in the previous message doesn’t seem to work, and a search in the ObjAPI didn’t return an AddExisting… either. My guess is that its not active on their site yet.
Thanks for your help with this !
– Dave
February 15, 2002 at 10:22 pm #6392That’s correct about the Clone message limitation. Sorry about the URL, I posted the one which goes to the main page. The following should be correct:
http://developer.novell.com/ndk/doc/gwobjapi/gwobjenu/data/huyzfn9z.html
It certainly doesn’t look like an easy one to use but I found the following basic code created a blank message in the Mailbox:
Call GroupWise.Account.MailBox.Messages.AddExistingMessage(“Joe”, “joe@bloggs.com”, “”, Date, 1, 0, 2, 0)
You’ll note that it is not a personal message and cannot be edited via the client. There are some other parameters which need to be used to point it to the content of an existing message structure, which I believe would fill in the other fields.
Regards,
Advansys Support
February 16, 2002 at 7:16 am #6395I’ll give it a try!
February 17, 2002 at 1:31 am #6390No problem. Let us know if you have any problems.
Regards,
Advansys Support
-
AuthorReplies
- You must be logged in to reply to this topic.