Create a toolbar button to copy and paste text

~ Ideally, I’d like to create a toolbar button to copy text to the clipboard. Is this possible? I see from the help file that this code is available:

procedure NavigateCommand(const Command: Integer);

and I know that 3 is the appropriate integer for Copy, but I don’t know where to put this code in relation to my toolbar button.

~ I’d also like to disable the Paste option in the context menu, as there would never be a reason for the user to paste something into the ebook. Is this possible?

~ I have created a toolbar button to take the user to a URL, but I don’t know how to make the target a popup window. This option is available for menu items. Is it not available for buttons?

  • Open your UserMain script (in the script editor) and paste this code:

    procedure MyButtonCopy;

Then, in the toolbar editor, choose your button, click “Execute this script function” and choose UserMain.MyButtonCopy

  • You can achieve this using the default security profile: in “Page Restrictions”, choose “Disable Paste command” (see

  • This feature will be available in HTMLExe 4. Until that, you have to rely on a HEScript script as explained above, but you would call ShowPopup instead of NavigateCommand.

Thank you! Your explanations were clear and everything works as I’d like it to.

This topic was automatically closed after 24 hours. New replies are no longer allowed.