Mini Problem: A custom mail-form create a custom task-form

  • Thread starter Christoph Sbach
  • Start date
C

Christoph Sbach

I want to fill out the task body field with the mail message field.

But the line: AssignedItem.Body = item.Message don't work.

What is wrong?





Sub cmdCreateTask_Click

Dim TaskFolder, SourceFolder
Set TaskFolder =
Item.Application.ActiveExplorer.CurrentFolder.Parent.Folders("Supportaufgabe
n")
Set Application.ActiveExplorer.CurrentFolder = TaskFolder

'das Formular benutzen..
Set AssignedItem = TaskFolder.Items.Add("IPM.Task.Neue Aufgabe")

' Eine neue Aufgabe mit den Customfeldern

AssignedItem.userproperties.find("TicketID").Value =
item.userProperties.find("TicketID").Value
AssignedItem.userproperties.find("Gerät").Value =
item.userProperties.find("Gerät").Value
AssignedItem.userproperties.find("Anfordergrund").Value =
item.userProperties.find("Anfordergrund").Value
AssignedItem.userproperties.find("Anforderer").Value =
item.userProperties.find("Anforderer").Value
AssignedItem.Subject = item.Subject 'No Problem

' AssignedItem.Body = item.Message 'Error
' If I re-comment this Line, the Mail-Form create a Task-Form, but without
the Message-Text

AssignedItem.save
End Sub
 
H

Hollis D. Paul

But the line: AssignedItem.Body = item.Message don't work.

What is wrong?
Message is not the name of the field containing the text of a message
item. Try Body for the email message also. You did notice that a task
form is really a modified message form, didn't you?

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2195
http://search.support.microsoft.com/kb/c.asp?FR=0&SD=TECH&LN=EN-US

Mukilteo, WA USA
 
C

Christoph Sbach

Hi,
it works fine with .Body
:)

But now next little problem:
My email-form.Body contains Pictures, its in Outlook-RTF-Format.
That was'nt supported bei my task-form.Body:
Only text is copied, if I try: task.Body=mail.Body ..

Then I 've try it manually, with drag and drop from email-form to task-form,
and now it looks like, that the task become a attachement now.

How I can resolve this Cheese. ;-)
 
K

Ken Slovak - [MVP - Outlook]

To copy RTF you would need to either copy an item using the Outlook
object model which you can't do if the source is a task and the target
is an email or you have to use undocumented CDO/MAPI properties. All
of the RTF* properties would have to be copied.

I'd suggest getting a copy of OutlookSpy (www.dimastr.com) and
starting to look at all the RTF* properties you would need to work
with, then going to www.cdolive.com/cdo10.htm for information about
CDO property tags and www.cdolive.com/cdo5.htm for CDO code samples.

There is also information about RTF on the www.dimastr.com Web site in
the Redemption section that you should look at.
 
H

Hollis D. Paul

How I can resolve this Cheese. ;-)
Try setting the task form to rtf before you copy the body fields.
Others have complained that doing anything with the Body field
automatically moves it to rtf format, so if the rtf property is Read
Only, then move some text into it and deleted it.

Another possibility is to set the HTML editor to 1. That may take the
picture better than the regular editor.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2195
http://search.support.microsoft.com/kb/c.asp?FR=0&SD=TECH&LN=EN-US

Mukilteo, WA USA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top