set the text of an Action Control to a document property - properties

Is there a way to set the text of an Action Control to the value of a document property?
i.e. I have a property FooProp. I want to set the label text of a button to ${FooProp} so that when FooProp gets updated (via script), the button text changes.
Thanks.

I do not think you can set the Display Text of a button to a document property.
You could really easily create an HTML button that does similar functionality but could still have a dynamic title. Simply create a button and set the name of the button to a Spotfire Label equal to that Document Property. Then perhaps use a python script or other script to do work e.g. change page, load data, etc. Depends on your use case.

Related

Create custom button in Qlikview

Is there any possible way that I can create my own custom button?
Something like creating a button in Photoshop with a specific extension and then using it inside Qlikview in a correct way, or a button object just like the others Qlikview already have..
Ps. I know I can use an image in a text object and then set it like a button, but as a image, the file gets heavier...
Can I create a Qlikview button?
Thanks!

(VB 2010) Label's Text extends from it's locked size. How do I scroll to last line?

I've been writing a program that calls batch files (which download some stuff). I've added a label that reports the download progress to the user. The program is going to allow for multiple downloads so at some point the Label will be full of text. When that happens, the text extends from the label and I can't see any of it. What I want is to have the label scroll to the newer line of text added in the label. In other words I want to always have the focus of the label text to be on the last written line. Can some1 post an example that can do this on a label ?
Similar to Steve's comment I would recommend using a multiline text box or RichText control for this purpose. You can set the control's ReadOnly property to True, and the ScrollBars property to Both.
When adding new text to this control, you can use the following code to ensure that it is visible to the user:
TextBox2.AppendText('New text')
TextBox2.SelectionStart = TextBox2.Text.Length
TextBox2.ScrollToCaret()

Turn off field programmatically in VB.Net

I'm creating an addin button in Arcmap via VB.net that when clicked, runs the identify tool. But I want only selected fields to appear in the identify dialog. I thought of hiding the unnecessary fields and then showing them again after the button is used.
Does anyone know how to programmatically turn off/on field?
you have to iterate the fields in layer and then set visible property into false .
see this link in
gis.stackExchange

In RealStudio, how can I intercept pasting of rich text?

I'm trying to create a simple text field for WYSIWYG editing. However, I only want to allow certain types of formatting (e.g. Bold, Italic, Underline and a single heading type but no colors or different fonts.)
The issue is if I use an editor that can accept formatting, someone can create or copy formatted text in another program, then simply paste it into the text field and all that formatting goes with it, allowing things I'm not interested in, such as different fonts, colors, etc. I don't want to allow that.
At best, I want to automatically strip out any formatting that I don't support. At worst, I want to simply paste whatever as plain text making them have to reformat it. But in no case do I want to just dump the clipboard to the text area.
Any thoughts on how to do this?
I would recommend creating a new text field/text area class and creating an EditPaste menu handler that (a) does what you're looking for in terms of handling the clipboard's text and (b) returns true to prevent the default pasting from happening. This is safer than using the Key down events because the user might manually select paste from the edit menu.
You can access the text on the clipboard by creating a Clipboard object.
To subclass the textfield and intercept the paste menu command:
With your Project open, go to Project Menu > Add > Class
Select the new class in the project's tab and in the properties panel set the super to TextField
Double-click on the class to edit it
Click the "Add Menu Handler" mid-toolbar button in your class
Change the menu item name to "EditPaste". Put your code in before the "return true" and be sure to leave the return true in there.
Your code can then format and paste the text manually and override the default paste function.
Any command-V or control-V in that text field will cause that menu handler to fire. Any contextual menus would be added by you anyway since real basic does not create the default contextual menus, so you'd have control over that as well.
To add the text field to a window, just change the filter above the objects list to Project controls, and drag the class in from there.
You could intercept the paste yourself by intercepting it in the KeyDown events. Then, you could look to parse it yourself. That could be kind of tricky but I think that's about the only way you could do it.
It might just be easier to parse the resulting StyleRun after the paste and strip out formatting you don't want.
Alternately, you could look at the Formatted Text Control from True North Software and override the paste methods of the control (you get all the source) and just handle it yourself.
Either way, I think it will be a fair amount of work.

Setting Lotus Notes section border using VBA

Friends,
I'm using VBA to create Lotus emails populated from an Excel spreadsheet, and I'm stuck on a really silly point.
When I create a new section in the note, business rules require me to give it a border. They've been doing this manually for years and are used to doing this from the Notes UI. They create a new section, then go to its properties and then change it to have a border (please see the border and style part in the properties window in this screenshot).
I can't figure out how to add this border through VBA. Any ideas? I've tried changing the TitleStyle, but that only affects things like fonts and color. I have everything else done, just stuck on the border!
Thanks!
Mike
The NotesRichTextSection class doesn't give you any way to change the border, unfortunately. Rich text items in Lotus Notes aren't supported very well via the API, so often you'll find a mismatch between what you can do on the client vs. what you can do in code.
There might be a workaround if you're up for trying it. First you need to create a simple form in Notes that has a rich text field, let's call it Body, surrounded by a section. Setup the section to appear however you want, with the border set, etc. You'll also need another hidden text field, called Title, and you'll set the section's title to be computed based on that Title field.
Then in your VBA code you're going to create a new NotesDocument based on that form. You'll set the Title field, and you'll add content into the Body rich-text item. Then you'll need to call the ComputeWithForm method followed by the Save method. Finally, you can use the RenderToRTItem method on the document to put the entire document into your original note's rich text field. Make sense?
No guarantees that will work from VBA, but I've done similar things in the past using LotusScript and it did the trick.
You could just set the borders of the cells you are copying using the Borders() property.
Example:
Range("B2:C4").Borders.LineStyle = xlDash
Range("B2:C4").Borders(xlEdgeBottom) = RGB(255,0,0)