![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Hello,
My Add-In adds a new Property to eMails. I use the typelibraries for Outlook2000. The Add in is developed in Delphi. The userdefined field 'Printed' will set in the Inspector but not in the INBOX-Folder. In Inspector: var AMailItem: MailItem; AUserProperty: UserProperty; AMailItem := FOutlookApp.ActiveInspector.CurrentItem as MailItem; AProp := AMailItem.UserProperties.Find('Printed', EmptyParam); if AProp = Nil then begin AProp := AMailItem.UserProperties.Add('Printed', olText, True, EmptyParam); AProp.Value := 'YES'; end else begin AProp.Value := 'YES'; end; AMailItem.Save; In the Inspector it works correct In Folder (InBox): AMailItem := FOutlookApp.ActiveExplorer.Selection.Item(1) as MailItem; AProp := AMailItem.UserProperties.Find('Printed', EmptyParam); if AProp = Nil then begin AProp := AMailItem.UserProperties.Add('Printed', olText, True, EmptyParam); AProp.Value := 'YES'; end else begin AProp.Value := 'YES'; end; AMailItem.Save; In the INBOX-Folder it not works. No Error - but the Field will not displayed. Can someone help me? franz |
#2
|
|||
|
|||
![]()
Did you actually step through your code? If UserProperties.Find cannot find
a property, it raises an error (DISP_E_UNKNOWNNAME), but you never trap it. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "franz" wrote in message ... Hello, My Add-In adds a new Property to eMails. I use the typelibraries for Outlook2000. The Add in is developed in Delphi. The userdefined field 'Printed' will set in the Inspector but not in the INBOX-Folder. In Inspector: var AMailItem: MailItem; AUserProperty: UserProperty; AMailItem := FOutlookApp.ActiveInspector.CurrentItem as MailItem; AProp := AMailItem.UserProperties.Find('Printed', EmptyParam); if AProp = Nil then begin AProp := AMailItem.UserProperties.Add('Printed', olText, True, EmptyParam); AProp.Value := 'YES'; end else begin AProp.Value := 'YES'; end; AMailItem.Save; In the Inspector it works correct In Folder (InBox): AMailItem := FOutlookApp.ActiveExplorer.Selection.Item(1) as MailItem; AProp := AMailItem.UserProperties.Find('Printed', EmptyParam); if AProp = Nil then begin AProp := AMailItem.UserProperties.Add('Printed', olText, True, EmptyParam); AProp.Value := 'YES'; end else begin AProp.Value := 'YES'; end; AMailItem.Save; In the INBOX-Folder it not works. No Error - but the Field will not displayed. Can someone help me? franz |
#3
|
|||
|
|||
![]()
Hi Dmitry
I tested it. That is not the problem. When i cannot find the property, i add it to the 'AmailItem'. After adding the property i can find it, but the property will not saved and i cannot see it in the Folder. I hope this helps you. Franz "Dmitry Streblechenko" wrote: Did you actually step through your code? If UserProperties.Find cannot find a property, it raises an error (DISP_E_UNKNOWNNAME), but you never trap it. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "franz" wrote in message ... Hello, My Add-In adds a new Property to eMails. I use the typelibraries for Outlook2000. The Add in is developed in Delphi. The userdefined field 'Printed' will set in the Inspector but not in the INBOX-Folder. In Inspector: var AMailItem: MailItem; AUserProperty: UserProperty; AMailItem := FOutlookApp.ActiveInspector.CurrentItem as MailItem; AProp := AMailItem.UserProperties.Find('Printed', EmptyParam); if AProp = Nil then begin AProp := AMailItem.UserProperties.Add('Printed', olText, True, EmptyParam); AProp.Value := 'YES'; end else begin AProp.Value := 'YES'; end; AMailItem.Save; In the Inspector it works correct In Folder (InBox): AMailItem := FOutlookApp.ActiveExplorer.Selection.Item(1) as MailItem; AProp := AMailItem.UserProperties.Find('Printed', EmptyParam); if AProp = Nil then begin AProp := AMailItem.UserProperties.Add('Printed', olText, True, EmptyParam); AProp.Value := 'YES'; end else begin AProp.Value := 'YES'; end; AMailItem.Save; In the INBOX-Folder it not works. No Error - but the Field will not displayed. Can someone help me? franz |
#4
|
|||
|
|||
![]()
I had no problem running the following VB script. Does it work for you?
set Msg = Application.ActiveExplorer.Selection.Item(1) on error resume next err.Clear set prop = msg.Userproperties.Find("Printed") if (prop is Nothing) or (err.Number 0) Then set prop = msg.UserProperties.Add("Printed", olText, true) End If prop.Value = "YES" msg.Save Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "franz" wrote in message news ![]() Hi Dmitry I tested it. That is not the problem. When i cannot find the property, i add it to the 'AmailItem'. After adding the property i can find it, but the property will not saved and i cannot see it in the Folder. I hope this helps you. Franz "Dmitry Streblechenko" wrote: Did you actually step through your code? If UserProperties.Find cannot find a property, it raises an error (DISP_E_UNKNOWNNAME), but you never trap it. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "franz" wrote in message ... Hello, My Add-In adds a new Property to eMails. I use the typelibraries for Outlook2000. The Add in is developed in Delphi. The userdefined field 'Printed' will set in the Inspector but not in the INBOX-Folder. In Inspector: var AMailItem: MailItem; AUserProperty: UserProperty; AMailItem := FOutlookApp.ActiveInspector.CurrentItem as MailItem; AProp := AMailItem.UserProperties.Find('Printed', EmptyParam); if AProp = Nil then begin AProp := AMailItem.UserProperties.Add('Printed', olText, True, EmptyParam); AProp.Value := 'YES'; end else begin AProp.Value := 'YES'; end; AMailItem.Save; In the Inspector it works correct In Folder (InBox): AMailItem := FOutlookApp.ActiveExplorer.Selection.Item(1) as MailItem; AProp := AMailItem.UserProperties.Find('Printed', EmptyParam); if AProp = Nil then begin AProp := AMailItem.UserProperties.Add('Printed', olText, True, EmptyParam); AProp.Value := 'YES'; end else begin AProp.Value := 'YES'; end; AMailItem.Save; In the INBOX-Folder it not works. No Error - but the Field will not displayed. Can someone help me? franz |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem with outlook receiving same emails two times | [email protected] | Outlook - General Queries | 2 | June 1st 06 07:25 PM |
problem with cut emails in greek | John Jay Smith | Outlook Express | 3 | April 9th 06 05:03 PM |
Problem replying to emails... | Mark (MSA) | Outlook - General Queries | 5 | March 15th 06 10:20 PM |
Outlook emails problem | chesjak | Outlook - Installation | 1 | March 15th 06 10:00 AM |
Moving Emails to Folders - Problem | [email protected] | Outlook - General Queries | 1 | February 21st 06 04:40 PM |