Automation Contact folder Outlook

KlaasFeenstraKlaasFeenstra Member Posts: 35
Hello, I am trying to synchronize Navision contacts with outlook contacts. I have a problem.
I need to know how to check if the GET (in the code below Getfirst) really gets an entry. The example below works till the contacts folder is empty, but I don´t know how to find out that the automation variable is not initialized.

CREATE(olApp);
objNS := olApp.GetNamespace('MAPI');
olFolders := objNS.Folders;
bcmRootFolder := olFolders.Item('Business Contact Manager');
bcmContactsFldr := bcmRootFolder.Folders.Item('Business Contacts');
existContact := bcmContactsFldr.Items.GetFirst;
MESSAGE(existContact.FileAs);
If existContact.typename = 'nothing'
string := existContact.FileAs;
WHILE NOT (string = '') DO BEGIN
existContact.Delete;
existContact := bcmContactsFldr.Items.GetFirst;
string := existContact.FileAs;
END;

In Visual basic there exist the TypeName command.... This is what I need.
SOLUTION: In Nav you have the ISCLEAR command.... (It´s my first time playing with automation in Nav)

Answers

  • garakgarak Member Posts: 3,263
    use clear command to give memory free, use create command to allocate memory for the dll and use isclear() command, if you will check if the dll is loaded.

    regards
    Do you make it right, it works too!
Sign In or Register to comment.