Registering Custom Tasks as Capabilities in the SAS Add-In for Microsoft Office

Overview

Custom add-in tasks are .NET assemblies (DLL files) that you create, deploy, register, and execute from the SAS ribbon in Microsoft Office applications.
To provide access to custom tasks based on the job responsibilities in your organization, you can register custom tasks as capabilities, assign the capabilities to roles, and assign users to roles.
The process of creating, deploying, registering, and executing custom tasks as capabilities in the SAS Add-In for Microsoft Office is similar to the process that is used in SAS Enterprise Guide.

Create Custom Tasks

To create custom tasks, you develop Windows executables and package them as .NET assemblies. It is convenient to assemble multiple tasks in a single .NET assembly so that you can share code and implementation among the tasks. For additional information, sample DLLs, and sample executable source files, see Creating Custom Add-In Tasks for SAS Enterprise Guide, at http://support.sas.com/documentation/onlinedoc/guide/customtasks/index.htm.reference.

Deploy Custom Tasks

You can deploy custom tasks to computers that run the SAS Add-In for Microsoft Office in two ways, using drop-in deployment or add-in deployment. Drop-in deployment copies .NET assemblies into specific local directories that are recognized by the SAS Add-In for Microsoft Office. Custom tasks in drop-in directories are automatically registered (made available for execution) the next time the user starts a Microsoft Office application.
Add-in deployment copies .NET assemblies into any local directory. You then identify those directories for use in the SAS Add-In for Microsoft Office using the Add-In Manager in SAS Enterprise Guide. Deployment registration makes the custom tasks available for execution from the SAS ribbon in Microsoft Office applications.
When you deploy your custom tasks, make sure that you include any dependent assemblies that are referenced by those tasks. At the same time, make sure that you do not include any dependent assemblies that are provided by the SAS Add-In for Microsoft Office or by SAS Enterprise Guide.
Follow these steps to use the Add-In Manager:
  1. Copy the .NET assembly into one of the following directories:
    • C:\ProgramFiles\SAS\Add-InForMicrosoftOffice\version\Custom
    • %appdata%\SAS\Add-InForMicrosoftOffice\version\Custom
      %appdata% is the Microsoft Window environment variable that maps to a user account. Repeat the copy in other user accounts if multiple users run the SAS Add-In for Microsoft Office on the same host.
    • %appdata%\SAS\SharedSettings\version\Custom
      Use this method to deploy custom tasks to specified user accounts, using a shared directory that is accessed by both the SAS Add-In for Microsoft Office and SAS Enterprise Guide.
  2. Start or restart a Microsoft Office application to register the custom tasks and make them available for testing.
Follow these steps to use add-in deployment:
  1. Copy the .NET assembly into any local directory.
  2. Start SAS Enterprise Guide and open the Add-In Manager. Select Toolsthen selectAdd-Inthen selectAdd-In Manager.
  3. In the Add-In Manager dialog box, select Browse .
  4. Navigate to the directory where you stored your .NET assembly.
  5. Click Open to display the names of the custom tasks in the assembly.
  6. Click OK to accept the custom tasks and register them in SAS Enterprise Guide.
  7. Test the new custom tasks in a Microsoft Office application.

Register Custom Tasks As Capabilities

After you deploy custom tasks, follow these steps to register custom tasks as capabilities:
  1. In SAS Enterprise Guide, start SAS Enterprise Guide Explorer. Select Toolsthen selectSAS Enterprise Guide Explorer.
  2. In Explorer, select Toolsthen selectTask Import Wizard.
  3. In the first page of the Task Import Wizard, you see your current metadata profile connection. If you need to connect with a different profile, click Cancel to close the wizard and select Filethen selectManage Profiles. After you change your profile, click Close, then start the Task Import Wizard.
  4. In the second page of the Task Import Wizard, specify the location of the directory where you copied your .NET assembly. Note that the directory that you select must be local to your current host.
  5. Select tasks to receive metadata, then click Finish in the sixth wizard page to create metadata.
If you are unable to create metadata, then you might need to install the package named SAS Add-In for Microsoft Office Server Data on the host that contains your current metadata repository.

Apply Custom-Task Capabilities to Roles

Follow these steps to apply custom-task capabilities to roles:
  1. In SAS Management Console, open the User Manager.
  2. To create a new role for your custom-task capabilities, right-click in the User Manager and select Newthen selectRole.
  3. To add a custom-task capability to an existing role, double-click an Add-In for Microsoft Office role.
  4. In the role properties window, click the Capabilities tab.
  5. In the Capabilities tab, expand the Plug-Ins branch in the tree view.
  6. Click the custom-task capabilities that you want to add to that role.
  7. Click OK.
The custom-task capabilities will be applied to the role the next time that affected users initialize a Microsoft Office application.