|
|
|||
Home Products Downloads Registered users Support Prices Order Primary Subscription |
|
||
Please note, this is the old version of Add-in Express. Add-in Express 2008 for .NET, VSTO and Delphi are now available. See also the latest version of Delphi HowTo for Outlook, Excel, Word. AddIn_Initialize:
AddIn_ControlEvent:
Special things:
AddIn_Initialize:
var IStdBar: IaxpCmdBar;
... IStdBar := FIXL.CommandBars.Item['Standard'];
AddCmdBar(CmdBarBtns2, NewCtrl);
3. How to specify the position of new CommandBar
AddCmdBar(CmdBarEdits, NewCtrl, msoBarTop);
AddCmdBar(CmdBarBtns1, NewCtrl, msoBarLeft); 4. How to create CommandBarEdit
AddEdit(CmdBarEdits, 'Edit1', Edt01Tag, 'This is an edit control', msoComboNormal, NewCtrl);
5. How to create CommandBarEdit with the label
var
IEdt: IaxpEdit;
...IEdt := AddEdit(CmdBarEdits, 'Edit2:', Edt02Tag, 'This is an edit control', msoComboLabel, NewCtrl); 6. How to set text in CommandBarEdit
if NewCtrl then
IEdt.Text := 'abc';
7. How to change the width of CommandBarEdit control
if NewCtrl then
IEdt.Width := 150;
8. How to create CommandBarCombobox
var
ICBox: IaxpComboBox;
...ICBox := AddComboBox(CmdBarEdits, 'Combo1', CBox01Tag, 'This is a combobox', msoComboNormal, false, NewCtrl); 9. How to split CommandBarControls
if NewCtrl then
ICBox.BeginGroup := true;
10. How to populate CommandBarCombobox
if NewCtrl then begin
ICBox.AddItem('First', EmptyParam);
end;
ICBox.AddItem('Second', EmptyParam); ICBox.AddItem('Third', EmptyParam); ICBox.AddItem('Fourth', EmptyParam); 11. How to create CommandBarDropdown
ICBox := AddComboBox(CmdBarEdits, 'Combo2', CBox02Tag, 'This is a dropdown control', msoComboLabel, true, NewCtrl);
if NewCtrl then begin
ICBox.AddItem('First', EmptyParam);
end;
ICBox.AddItem('Second', EmptyParam); ICBox.AddItem('Third', EmptyParam); ICBox.AddItem('Fourth', EmptyParam); 12. How to initialize CommandBarDropdown
if NewCtrl then
ICBox.ListIndex := 1;
13. How to split values in CommandBarCombobox
if NewCtrl then
ICBox.ListHeaderCount := 2;
14. How to change the dropdown width of CommandBarCombobox
ICBox.DropDownWidth := 150;
15. How to create CommandBarButton
AddButton(CmdBarBtns1, 'Click me', Btn01Tag, 'This is a standard button', '', msoButtonCaption, NewCtrl);
16. How to set the icon and caption of CommandBarButton
var
IBtn: IaxpButton;
...IBtn := AddButton(CmdBarBtns1, 'Fix me', Btn02Tag, 'This is a button with fixed state', 'ADDINXP', msoButtonIconAndCaption, NewCtrl); Note: The 'ADDINXP' string is name of bitmap resource. 17. How to create a new group in CommandBar
IBtn.BeginGroup := true;
18. How to insert CommandBarControl before another control
AddButton(CmdBarBtns1, 'Show/Hide BigButtons', Btn04Tag, 'Show/Hide BigButtons commandbar', '', msoButtonCaption, NewCtrl, 3);
19. How to create CommandBarPopup
var
IPopup: IaxpPopup;
...IPopup := AddPopup(CmdBarBtns1, 'Pop-up', Popup01Tag, 'This is a pop-up control', NewCtrl); 20. How to add CommandBarControl to the pop-up control (CommandBarPopup)
// Button
AddButton(CmdBarBtns1, 'Button7', Btn07Tag, 'This is a button', 'ADDINXP', msoButtonIconAndCaption, NewCtrl, -1, IPopup); // Edit AddEdit(CmdBarBtns1, 'Edit', Edt03Tag, 'This is an edit control', msoComboLabel, NewCtrl, -1, IPopup); 21. How to add a menu item to the standard menu
var
IPopup: IaxpPopup;
...MenuName: string; MenuName := 'File'; // Warning! Depends on localization. IDispatch(IPopup) := OLEVariant(CmdBars.ActiveMenuBar).Controls.Item[MenuName]; AddButton(MenuName, 'MyItem', 'MyItemTag', 'This is a my menu item', 'ADDINXP', msoButtonIconAndCaption, NewCtrl, MyPosition, IPopup); 22. How to add CommandBarControl to the standard CommandBar
var
BarName: string;
...BarName := 'Standard'; // Warning! Depends on localization. AddButton(BarName, 'MyButton', 'MyButtonTag', 'My button hint', 'MyButtonBitmatResourceName', msoButtonIcon, NewCtrl, 1); 23. How to add a custom submenu to the Excel's main menu
procedure TMyAddIn.AddIn_Initialize;
var
IPopup: IaxpPopup;
begin
IsNew: boolean;
inherited;
end;
// Warning! The 'Worksheet Menu Bar' string is // the Excel's menubar name and depends on // localization. You can get the menubar name // through CmdBars.Item[0].NameLocal IPopup := AddPopup('Worksheet Menu Bar', 'My submenu',
'ADXHT001', '', IsNew, 5);
AddButton('Worksheet Menu Bar', 'Item 1',
'ADXHT001-01', '', '', msoButtonCaption, IsNew,
AddButton('Worksheet Menu Bar', 'Item 2',-1, IPopup);
'ADXHT001-02', '', '', msoButtonCaption,
IsNew, -1, IPopup); 24. How to add a button to the Excel's main menu
procedure TADXHT001.AddIn_Initialize;
var
IPopup: IaxpPopup;
beginIsNew: boolean;
inherited;
end;
// Warning! The 'Worksheet Menu Bar' string is // the Excel's menubar name and depends on // localization. You can get the menubar name // through CmdBars.Item[0].NameLocal AddButton('Worksheet Menu Bar', 'My Button',
'ADXHT002', '', '', msoButtonCaption, IsNew, 6);
AddIn_ControlEvent:1. How to create an event handler of CommandBarEdit
if Tag = Edit1Tag then
ShowMessage(Format('Ooops... I am the %s edit control.'#13'My new value is %s.',
[Tag, (ICtrl as IaxpEdit).Text]));
2. How to create an event handler of CommandBarCombobox
if Tag = CBox01Tag then
ShowMessage(Format('Hm... I am the %s combobox.'#13'My new value is %s.',
[Tag, (ICtrl as IaxpComboBox).Text]));
3. How to create an event handler of CommandBarButton
if Tag = Btn01Tag then
ShowMessage(Format('Hm... I am the %s button.', [Tag]));
4. How to set the state of CommandBarButton
if Tag = Btn02Tag then begin
IBtn := ICtrl as IaxpButton;
end;
if IBtn.State = msoButtonUp then
IBtn.State := TOLEEnum(msoButtonDown)
else
IBtn.State := TOLEEnum(msoButtonUp);
5. How to find CommandBarControl
var
IEdt: IaxpEdit;
...IEdt := FindControl(CmdBarEdits, Edt01Tag, axpEdit) as IaxpEdit; 6. How to disable CommandBarControl
if Tag = Btn03Tag then
if Assigned(IEdt) then
IEdt.Enabled := not IEdt.Enabled;
7. How to show/hide CommandBar
if Tag = Btn04Tag then
CmdBars.Item['MyBar'].Visible := not CmdBars.Item['MyBar'].Visible;
8. How to protect/unprotect CommandBar
if Tag = Btn05Tag then
if CmdBars.Item['MyBar'].Protection = msoBarNoProtection then
CmdBars.Item['MyBar'].Protection :=
msoBarNoResize + msoBarNoMove + msoBarNoChangeVisible
else
CmdBars.Item['MyBar'].Protection := msoBarNoProtection;
9. How to enable/disable all CommandBarControls on the specified CommandBar
if Tag = Btn06Tag then
for i := 1 to CmdBars.Item['MyBar'].Controls_.Count do
CmdBars.Item['MyBar'].Controls_.Item[i].Enabled :=
not CmdBars.Item['MyBar'].Controls_.Item[i].Enabled;
Special things:1. How to add to MS Excel a new worksheet function with an ADX add-in Download adxht-301-d7.zip (Delphi 7)
2. How to handle the FrontPage OnWindowActivate event Download adxht-302-d7.zip (Delphi 7)
3. How to add a new toolbar to the Inspector window of MS Outlook Download adxht-303-d7.zip (Delphi 7)
4. How to handle the ItemSend event of MS Outlook Download adxht-304-d7.zip (Delphi 7)
5. How to handle the TaskChange event of MS Project Download adxht-305-d7.zip (Delphi 7)
6. How to use XL Report.VCL inside an ADX add-in Download adxht-306-d7.zip (Delphi 7)
7. How to handle the WorkbookBeforeSave event of MS Excel Download adxht-307-d7.zip (Delphi 7)
8. How to scan Outlook folders Download adxht-308-d7.zip (Delphi 7)
9. How to handle the MouseClick event on presentation's objects (PowerPoint) Download adxht-309-d7.zip (Delphi 7)
10. How to add a new item to the context menu of the Selection (Word) Download adxht-310-d7.zip (Delphi 7)
11. How to handle Outlook's SelectionChange event. This is a complete solution that traps the event raised by Explorer and by the navigation buttons in Inspectors. Download adxht-312-d7.zip (Delphi 7)
12. How to get an access to the MAPIFolder within Outlook Property Page. Download adxht-313-d7.zip (Delphi 7)
13. How to handle the ExplorerClose event (Outlook). Download adxht-314-d7.zip (Delphi 7)
How to get more details
• Add-in Express Demo |
Developed forDelphi 5, 6, 7
[ Download it ] Immediate shipment
|