About using TadxOLSolutionModule

Add-in Express™ Support Service
That's what is more important than anything else

About using TadxOLSolutionModule
 
Donni Devito




Posts: 54
Joined: 2004-08-16
Hi,
I want to create Outlook folders by code. I saw that when I design folders in TadxOLSolutionModule, it creates every folder that you define. Now I want to create that folders by code. How can I add folders to TadxOLSolutionModule at runtime?

regards
Posted 11 Nov, 2014 09:52:26 Top
Andrei Smolin


Add-in Express team


Posts: 18806
Joined: 2006-05-11
Hello Donni,

You can modify the Folders collection of the TadxOlSolutionmodule in the AddinInitialize event of the add-in module.


Andrei Smolin
Add-in Express Team Leader
Posted 12 Nov, 2014 06:14:03 Top
Donni Devito




Posts: 54
Joined: 2004-08-16
Hi Andrei,
Thank you for the answer. Before posting, I investigated the Folders property. It has an Add method which type is TCollection. I could not figure out how can I add a folder to folders?

Regards.
Posted 12 Nov, 2014 06:17:47 Top
Andrei Smolin


Add-in Express team


Posts: 18806
Joined: 2006-05-11
Donni,

procedure TAddInModule.adxCOMAddInModuleAddInInitialize(Sender: TObject);
var
  rootFolder, newFolder: TadxOLSolutionFolder;
begin
  if adxOLSolutionModule1.Folders.Count > 0 then begin
    rootFolder := TadxOLSolutionFolder(adxOLSolutionModule1.Folders[0]);
    if Assigned(rootFolder) then begin
      newFolder := TadxOLSolutionFolder(rootFolder.Folders.Add);
      newFolder.FolderName := 'My Folder';
    end;
  end;
end;



Andrei Smolin
Add-in Express Team Leader
Posted 12 Nov, 2014 06:51:53 Top
Donni Devito




Posts: 54
Joined: 2004-08-16
Hi Andrei,
Thank you very much.

regards.
Posted 12 Nov, 2014 07:18:13 Top
Andrei Smolin


Add-in Express team


Posts: 18806
Joined: 2006-05-11
You are welcome!


Andrei Smolin
Add-in Express Team Leader
Posted 12 Nov, 2014 07:32:56 Top
Donni Devito




Posts: 54
Joined: 2004-08-16
Hi Andrei,
Im creating the folders at runtime because every time may be different folder names. I saw that old folders are not deleted. How come I may delete all the folders I created on finalize?

Regards.
Posted 12 Nov, 2014 15:37:56 Top
Donni Devito




Posts: 54
Joined: 2004-08-16
OK, I Found a way.
On the initialization Im getting Infox Folder name. On finalize, I find my added folder and delete recursively.

regards.
Posted 12 Nov, 2014 15:42:14 Top
Andrei Smolin


Add-in Express team


Posts: 18806
Joined: 2006-05-11
Thank you for posting this solution!


Andrei Smolin
Add-in Express Team Leader
Posted 13 Nov, 2014 04:27:03 Top