Outlook Automation

Stefan_LimpertStefan_Limpert Member Posts: 30
edited 2001-04-20 in Navision Financials
Hi Folks,
i want to open an Outlook-Taskitem with Automation, wich is already created. I have the "Entry-ID" of the Task-Item, but searching for Open- or Search-Methods. Is there a special way to open it ?
And now to something different:
How can I move Characters like "Line Feed" (13/10) to a Textfield?

Regards
Stefan

Comments

  • Lars_WestmanLars_Westman Member Posts: 116
    Hi Stefan

    You can search like this also (in this case contacts whith custom fields for storing the prospectno. and the contactno. and probably not the correct translation of field names):

    OlItems := OlMapiFolder.Items.Restrict('[Prospectno] = "' + Prospectno + '" AND [Contactno] = "' + Contactno + '"');
    IF OlItems.Count = 0 THEN
    EXIT(FALSE)
    ELSE
    OlContact := OlMapiFolder.Items.Find('[Prospectno] = "' + Prospectno + '" AND [Contactno] = "' + Contactno + '"');
    EXIT(TRUE);

    Line Feed You can add like this:

    Create a var of type char and assign that a value like this

    CR := 13;

    IF You wan't thre line feeds You do like this:

    FORMAT(CR)+FORMAT(CR)+FORMAT(CR)

    Hope that helps

    //Lars
  • Stefan_LimpertStefan_Limpert Member Posts: 30
    Thanks for your help Lars
    based on your advise i builded this code:

    IF Rec."Outlook Refer" <> '' THEN BEGIN
    OutlItems := OutlMapiFolder.Items.Restrict('[EntryID] = '+Rec."Outlook Refer");

    IF OutlItems.Count = 0 THEN
    OutlTaskItem := OutLAppl.CreateItem(3)
    ELSE
    OutlTaskItem := OutlMapiFolder.Items.Find('[EntryID] = '+Rec."Outlook Refer");
    ...
    (Rec is a Navision Table that contents the Entry ID of the TaskItem)
    but i only got the Error-Message 'The Call to Member Restrict failed. Condition cannot be parsed'
    what did i wrong?
    Stefan
  • Lars_WestmanLars_Westman Member Posts: 116
    In Your example the quotes are wrong.

    It should be:

    IF Rec."Outlook Refer" <> '' THEN BEGIN
    OutlItems := OutlMapiFolder.Items.Restrict('[EntryID] = "'+Rec."Outlook Refer" + '"');

    IF OutlItems.Count = 0 THEN
    OutlTaskItem := OutLAppl.CreateItem(3)
    ELSE
    OutlTaskItem := OutlMapiFolder.Items.Find('[EntryID] = "'+Rec."Outlook Refer" + '"');

    You can see the correct syntax in the MS Outlook Help for it's Object Library (which You can open from the script editor in Outlook)

    /Lars
  • Stefan_LimpertStefan_Limpert Member Posts: 30
    Ok Lars,
    thats it! But unfortunally the ENTRYID is not allowed in "Restrict" or "Find". This is "Microsoft Live and colored", isnt it? I solved the problem now with the Property "Ordinal". If you have any suggestion for a better soluton,please tell me.

    By the way in Outlook the "Date"-Type contents Date+Time, is that right?
    How can i move a Time-Value from NF in an Outlook Date-Property (Example: Taskitem.ReminderTime)

    Greetings Stefan
  • Lars_WestmanLars_Westman Member Posts: 116
    Look in the download section. There You have automation examples and i think a solution to Your problem.

    In any way I know this has been discussed at mynavision.net or navision.net, so if You search these forums You should find the solution.

    //Lars
Sign In or Register to comment.