Outlook.. How can I filter mails on conversation IDs? - outlook-addin

public Microsoft.Office.Interop.Outlook.Search AdvancedSearch (string Scope, object Filter, object SearchSubFolders, object Tag)
Using above function of search, can I use filter on ConversationId without using filter on subjects?
Or can I get conversation ID of mails from the results of advanceSerach? If yes, then how?

Try to search on PR_CONVERSATION_TOPIC (DASL property name http://schemas.microsoft.com/mapi/proptag/0x0070001F).

Related

How to I write ModelBinder that access all fields by prefix?

For example, I like my ModelBinder to transform all "field_???" values to my single custom object.
How I could do that?
ValueProvider.GetValue only allows me to access by exact name, and I can't enumerate all possible fields...
Try this:
public IActionResult OnPost([Bind(Prefix = "field_")] Whatever model)
Read the article https://learn.microsoft.com/ru-ru/aspnet/core/mvc/models/model-binding?view=aspnetcore-5.0

Need a concept on fetching data with HQL while three or more tables are in use

A small briefing on what I am trying to do.
I have three tables Content(contentId, body, timeofcreation), ContentAttachmentMap(contentId, attachmentId) and Attachment(attachmentId, resourceLocation).
The reason I adopted to create the mapping table because in future application the attachment can also be shared with different content.
Now I am using HQL to get data. My objectives is as follows:
Get All contents with/without Attachments
I have seen some examples in the internet like you can create an objective specific class (not POJO) and put the attribute name from the select statement within its constructor and the List of that Class object is returned.
For e.g. the HQL will be SELECT new com.mydomain.myclass(cont.id, cont.body) ..... and so on.
In my case I am looking for the following SELECT new com.mydomain.contentClass(cont.id, cont.body, List<Attachment>) FROM ...`. Yes, I want to have the resultList contain contentid, contentbody and List of its Attachments as a single result List item. If there are no attachments then it will return (cont.id, contentbody, null).
Is this possible? Also tell me how to write the SQL statements.
Thanks in advance.
I feel you are using Hibernate in a fundamentally wrong way. You should use Hibernate to view your domain entity, not to use it as exposing the underlying table.
You don't need to have that contentClass special value object for all these. Simply selecting the Content entity serves what you need.
I think it will be easier to have actual example.
In your application, you are not seeing it as "3 tables", you should see it as 2 entities, which is something look like:
#Entity
public class Content {
#Id
Long id;
#Column(...)
String content;
#ManyToMany
#JoinTable(name="ContentAttachmentMap")
List<Attachment> attachments;
}
#Entity
public class Attachment {
#Id
Long id;
#Column(...)
String resourceLocation
}
And, the result you are looking for is simply the result of HQL of something like
from Content where attachments IS EMPTY
I believe you can join fetch too in order to save DB access:
from Content c left join fetch c.attachments where c.attachments IS EMPTY

Is it possible to retrieve SharePoint Lists by CAML request

Could anybody help me to retrieve SharePoint Lists (NOT List Items) by CAML request using Client Side Object Model (CSOM).
I know how to get List Items using CAML query (I can use GetItems() method in a List object):
public ListItemCollection GetItems(CamlQuery query_);
I would like to do the same thing with Lists, but can't find a way, is it possible?
I'm looking for something like this:
SP.Web.GetLists(CamlQuery query)
// "ctx" is the object of client context
ListCollection lists = web.Lists;
ctx.Load(lists);
ctx.ExecuteQuery();
In object "list" you will get all list names.

SPListItem id from SPField object

I am working on create a custom field type and for implementation issue I need to retrieve the ID of the SPListItem in the SPField class which belong to these field type but I can't retrieve it.
For example:
public class myField:SPFieldText
{
// I need ListItemID in this class
}
Can anyone help me please?
SPFieldText is an SPField, which is the schema definition for a field. Its like saying, given an SQL create table statement, give me the id of row x. Can't be done.
I think the logic you are trying to perform should be done in an event receiver, so say when an item is saved, you take the ID and add it to the text field.
I didn't find a solution but I've tried another solution which is
I can get the ID of the item in the New and Edit forms so I saved the ID and the field value as a one value separated by '/' and in the SPFieldText class I've been able to retrieve the ID value from the value of the field

How to get the recipient addresses within an IPM.DistList?

I'm trying to get the recipient addresses within an IPM.DistList that is stored in a public folder (of type contacts) in Exchange 2003.
The typeName of the object is a Message (with a parent object being a Messages collection) and the messageType is "IPM.DistList".
I can find documentation about IPM.DistListItems. DistListItems documentation lists no parent possibilities in MSDN.
We have an Exchange 2003 info store with Public Folders. Within those Public Folders is a [sub]folder (that holds items of type "Contact") that has distribution lists (IPM.DistList's) that have contact entries, members of the list essentially.
I need to get the addresses of the members of the lists in the Public Folder sub-folder.
Well, it's been over a year, but I feel some obligation to answer this question now that I've found it. The answer was, I think, that no documentation exists on this secret bit of Exchange, but was able to iterate through the list of addresses within each ipm.distlist by something like this:
for a = 0 to list.count-1
emladdress = list(a)(a).value
next
I don't know why "(a)(a)" works, but you have to have both of them there. And I don't actually remember if it was a zero-based index, so that's a guess. Good luck, and hopefully you can migrate your users off Exchange and into google apps. Seriously!