I need to get the value of an html input after some text has been pasted. Seems obvious to handle the input's onpaste event, but that appears to fire before the text is actually pasted.
For example...
When one pastes some text into that input the alert shows an empty string. Clicking ok then shows the pasted text appearing in the text box.
I've tried using setTimer("someFunction()", 1), then looking at the input inside someFunction(), but that seems like a kludge.
What's the best way to get to the input's text after something's been pasted?
Thanks!
Curt
Related
I have an Access form with textboxes that contain some default text. The users are required to replace the text with words of their own, so I wrote a macro to confirm that (before proceeding to the next record) the text boxes no longer contain the default text. (It gives user a warning plus some other tasks, which is why I'm not using built-in Validation rules.)
The macro contains this sequence:
SetLocalVar
Name: booDetailDefault
Expression = [Forms]![frmChangeReq]![txtProblem].[Text]=[Forms]![frmChangeReq]![txtProblem].[DefaultValue]
The idea is if ...[Text] is the same as ...[DefaultValue], then booDetailDefault would be TRUE, and if not, FALSE.
However, what I do get is "Type Mismatch". I would think that Text and DefaultValue would be the same type.
Can you tell why I got this error?
Is there any way to display the Text and DefaultValue values so I can see why Access thinks they're different?
Is there a better way to see if the text boxes have been changed?
EDIT: The default text is set in the Property Sheet for the textbox. I've been running it manually, not tying it to an event yet, until I get it working.
I used Text instead of Value because that's what was available in the Macro Builder, but just in case I tried changing it to Value. It works, although I have to tell the expression to expect quotation marks around half of it:
[Forms]![frmChangeReq]![txtProblem].[DefaultValue]="""" & [Forms]![frmChangeReq]![txtProblem].[Value] & """"
I have copied a picture from another slide and now want to paste it into a blank (picture or content) placeholder on the active slide. I'll loop through the shapes looking for such a blank placeholder, but can it then be coded to paste the picture into the placeholder? I don't know how to code that part, if it's even possible.
Thanks,
Mel Turco
if you already copied why not simply paste it?
ActivePresentation.Slides(slidenum).Shapes(copiedimage).Copy
ActivePresentation.Slides(slidenum).Shapes(placeholdernum).Select
ActivePresentation.Slides(slidenum).Shapes.Paste
this code works for me.
first line copies image, as shape, second selects place holder in which image should be pasted, and third one pastes it in selected placeholder
After selecting the chosen Placeholder use
ActiveWindow.View.Paste
I'm working on a pdf doc that includes input fields that have been edited. I'd like to be able to press select all and get all text from the document, but for some reason none of the input fields are included. Others have told me that if text isn't selectable, it must be an image, but in this case it's not - so is there a way to 'finalize' the edits and select the text? Maybe turn the doc into read only?
Edit: I've tried changing it to a read-only doc and it doesn't make the inputs selectable.
I have something like a diagramming UWP application where each shape has an RichEditBox. The problem is, that I loose the formatting when the text is empty.
For Example:
Change the text to bold: EditBox.Document.Selection.CharacterFormat.Bold = FormatEffect.On.
Delete all text
Get the text via "EditBox.Document.GetText(GetTextFormat.FormatRtf, out text);
=> The result is just an empty string, not valid RTF document at all. This is a problem in my scenario. Is there an approach to solve it? I think RichEditBox should always provide a valid RTF document.
I am writting to an excel file from my vb code. The code goes as below
xlsheet3 = xlBook.Sheets.Add(After:=xlSheet)
With xlsheet3
.Columns(5).NumberFormat = "#"
.Cells(j + 1, 5) = someStringValue 'Here "j" is a row counter and this line is in a "for loop"
end with
After writing to excel, most of the cells in excel are correct. But some of the cell's text comes as ####### however if I click on the cell, formula bar shows the correct result. I have tried giving single code before adding the text still that did not help.
Please help me in resolving this.
Thank you
There is not any issue with your code. You need to increase the width of the column or have to use word wrap. In excel if your value is not fully visible it shows it is "######".
If widening and wrapping text doesn't work and the format is set to text which allows display of only 255 characters, try changing the format to general.
This just indicates that the cell is too small for showing the result: make it wider.
See https://superuser.com/questions/65556/excel-displays-for-long-text-whats-wrong for some common reasons why Excel displays "######" in cells.
Either the cell is too narrow to display the contents or the contents are over 256 characters.
Check what you're writing to the cell. If it's not too long then all you need to do is resize the column to fit the new contents.
This is simply what Excel does when the data in a column is too wide to be displayed in the current column width. Make the column slightly wider and you will see all your data.
To autosize the column so it is wide enough to display all its data, double click the column divider at the right edge of the column, in the header bar.