Questionnaire list q&a in word - vba

I'm a typer in a Justice court. All the time topping Q and then the question. Then Enter and then A for answer.
I thought: why isn't there a way to automatically write those, just like when you write 1. and it automatically adds 2 when you press Enter?
Bottom line: I want to be able to have automatically written Q when I press Enter, and the next time I press Enter I'll have A written automatically.
Thank you to everyone in advance!! (First time I use stack overflow :D )

Related

COLAB, verification/accept issue

I need your help with colab, not receiving inputs like (y, yes) or (n, no), in which is necessary to continue my work. You see, the thing is, I want to be able to answer questions like (yes) and then press (enter), but its not accepting any other inputs.
Please help me - I really want to know how to do this.
Here is an example of the output:
(do you want to allow root access? (y/n):
but then I enter y and press Enter and still get no result, it does not receive the "Enter" keypress.

how to change colour of the text entered in label as we enter the desired regular expression in password text field?

I am new to objective C and I dont know if this can be done without any library or not but if yes kindly let me know...
I have a view in which I have added a button & textfield with some character like "A b # 1 6". Here I need to change the color of characters as I enter the password.
I mean to say when I enter T color or 'A' changes, p is pressed 'b' color changes and so on if I enter special character that color changes and minimum lenth is 6 so when I enter 6 character color of 6 changes.
I tried it with using regular expression but i need this functionality.
for refrence I am adding Image.
I have updated my code instead of labels I have taken Buttons to show the changes. Here is my code:
Now I want to know when user delete character from textfield the color should get back to normal color. I mean if user deletes "A" then button roundButtonCapital should change to normal button.
I hope I am clear. Please let me know if any doubt.
https://drive.google.com/file/d/0B3EymICOjqeNM01zcEQ4eUN0eUk/view?usp=sharing
Now I want to know when user delete character from textfield the color should get back to normal color.
At a guess when checking the user input you are only setting the color if the particular condition - uppercase, length, etc. - is met. You should always set the color, to the "passed" color if the condition is met and to the normal color if it is not. Do this on every change to the user input, addition or deletion, and your indicators will always be correct.
Note: You did not edit your question to include minimal code fragments, posting a link to a file is no substitute for this. You need to isolate the problem, which is what you should be doing anyway in trying to solve it, show the code for that issue in the question.
In this case you maybe could have include the code for a particular test - uppercase, digit, etc. - and explain what it was doing right and what didn't work. Maybe here because I don't know my answer is correct, it is a guess - to be sure I'd have to scroll through in detail 5 pages of code on a tablet I'm currently typing this on, essentially debug your code and that is not what Stack Overflow is here for.
You have help people help you, and show you've put effort in, or people just won't be willing to put in effort to help you.
That said, I hope the guess helps, and stick with SO asking and answering questions!

OneNote: Move screen/cursor to top of every single page in notebook

I have a series of OneNote 2010 notebooks, each with hundreds of pages across many sections and section groups, used as class participant workbooks. Editing a page's content leaves the display (cursor/screen/insertion point; not precisely sure how to define it) centered on the last edit.
(This is similar to Excel remembering your cursor location on reopening a spreadsheet, whereas Word, PowerPoint, others always open your document at the very top.)
When participants or facilitators open their notebooks, each page feels randomly displayed, since OneNote opens it at the last edit location. This should appear clean, professional, and organized.
How can I iterate through each and every page in a OneNote notebook, regardless of the organizational structure, and do the equivalent of CTRL-HOME CTRL-HOME? (The second one's for good luck. :-)
(Strangely, no one else seems to have asked this question. I can't find any UI way to do this. There may be a manual-edit-of-XML way, but that's beyond me. I'm familiar with VBA, but depend on the IDE for keywords and syntax, and don't understand the OneNote object model. So please consider me a script kiddie at best.)
Thanks!
Don't know if 4 months counts as an old question, but Autohotkey should be able to do, if not all, then much of this. I can think of one simple way, which would work best if the sections have similar numbers of pages. In a new .ahk script:
; This script assumes you are starting at the first notebook you want to
; change, and the first loop is the number of notebooks to change
; (the notebooks are all in order)
; related to ahk internals.
#sendmode, input
; Trigger the script with ctrl + winkey + t
^#t::
; Loop enough times for each notebook
loop, 10
{
; loop enough times to get through all the sections in the book
loop, 20
{
send !{home} ; alt home, go to first page in section.
; internal loop, enough times to get through all the pages
; in the biggest section
loop, 50
{
send ^{home} ; ctrl home. Cursor to start of page
send ^{pgdn} ; ctrl pgdown. Next page.
}
send ^{tab} ; ctrl tab. Next section.
}
;Shortcuts to open next notebook
send ^G
send {down}
send {return}
}
return
This script might not automatically go through notebooks, because onenote
blocks external up/down commands. It should be fine otherwise though. I haven't tested it.

How can I make one key do these 2 things?

Thanks in advance for the help. I have a job that requires repetitive keystrokes. To make my job easier, I need to do the following 2 things:
LButton::Send {LButton}{Tab}{Enter}
2nd: Count every time LButton is pressed.
Right now, I'm using 2 separate keystrokes:
1 above
and
2 - Spacebar to count, like this:
Counter=0
Space::Counter++
F12::MsgBox, %Counter%
So right now, I need to hit the LButton to perform my job task (left mouse, tab, enter) AND the Spacebar to count each time I do this.
I'd like to press the Left mouse, and make it do the left mouse, tab, enter sequence PLUS count the click. That way, I wouldn't have to press the spacebar each time I needed to count the action (for accuracy and ease of use).
Any idea how I could set up autohotkey to do this in a single click?
Thanks again. I've learned a ton from combing through the suggestions, and I'm enjoying how much easier my work has become with AHK.
Best,
Jesse

excel VBA break execution when there's no break key on keyboard [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I'm just noticing that on my laptop (Dell XPS 15z) there's no BREAK key (no dedicated number keypad). I'm running the debugger step-by-step and then when all seems fine, I just let it play out. However, it's running in an infinite loop and now I'm realizing there's no way to stop it without the break key!!!!
Is this a bad joke? I had to reboot the computer; is there a more graceful way??
just press the escape key twice ;-)
Solution #1 (It works most of the time):
When some particular keys (Pause, Break or ScrLk) are missing on the keyboard and pressing Esc 2, 3 or multiple times doesn't stop the macro too.
Step #01: If your keyboard does not have a specific key, please do not worry and open the 'OnScreen Keyboard' from Windows Utilities by pressing Win + U.
Step #02: Now, try any of the below option and of them will definitely work depending on your system architecture i.e. OS and Office version
Ctrl + Pause
Ctrl + ScrLk
Esc + Esc (Press twice consecutively)
You will be put into break mode using the above key combinations as the macro suspends execution immediately finishing the current task. For eg. if it is pulling the data from the web then it will halt immediately before executing any next command but after pulling the data, following which one can press F5 or F8 to continue the debugging.
When Solution #1 doesn't work or you need a permanent solution then try adding a new KEY to the Registry. (I am running Win 10 Creators Update on Dell 3530 Inspiron Laptop)
Disclaimer: Please only make changes to Windows Registry at your own risk and it is advisable only if you are windows administrator or have prior experience in the changing the key values in the registry.
You can also look for Solution #2 which use accessibility keyboard Win + U
Solution #2:
1) Click the START, then type REGEDIT into the search box. This will start the registry editor.
2) Explore the Registry, expanding each element
HKEY_LOCAL_MACHINE
-SYSTEM
-Current Control Set
- Control
- Keyboard Layout
Click on the Scancode Map, and EDIT the key values to match that shown below.
i.e. to have values of : 00,00,00,00,00,00,00,00,02,00,00,00,46,e0,44,00,00,00,00,00
Once Done you will need to reboot your laptop, but after that, you can use as the pause/Break Key.
To understand it in detail and customize it as per your needs, please refer this link: KeyBoard Scancodes
I have a Dell Precision without a Pause/Break key but there is a replacement for that: Fn + B, so:
- Fn + B == Pause (pause execution);
- Ctrl + Fn + B == Break (break execution);
- Win + Fn + B == Windows + Pause (open System properties).
You can execute the command:
dir /s C:\
and test the Pause and Break combination keys while dir lists all files in drive C.
reference
Despite this being an old question, I have just encountered the same issue and discovered that Ctrl+Scroll lock works as a break.
"Scroll lock" can be accessed on my DELL Laptop via the blue function key "Fn" and the "F6" key which has a small blue lock symbol on it with an ⇳ symbol in it. At other computers it may look like ⤓ . So effectively I press Ctrl+Fn+F6.
I have an HP laptop and this works when I want to break after a msgbox, hold fn+ctrl and click right shift key (has pause on it as well) then respond to msgbox and code will break.
On my Dell at least : ctrl + alt + esc BEFORE your cursor starts looping itself
I got this info from aidangrogan on this website :
http://en.community.dell.com/support-forums/laptop/f/3518/t/19355018
So I don't claim to have found it myself. All credits to him (or her)
Hold CTRL+Fn & hit Shift - Stopped my macro from running. I don't have a 'Break' key either on the keyboard of my HP Pavilion G7.
Ctrl + Fn + B works for Excel 365 (Office 365) on my Dell Latitude 5480 (no Break key).
I found this thread and saw the solution that has the most votes, but then realized my laptop has no Pause, Break or ScrLk) keys. I tried other proposed solutions, like 'OnScreen Keyboard' or alternative key combinations, but those didn't work either.
Then it hit me: if it's a phantom break point associated with particular line(s) of code, why not just get rid of the line(s)?
So that's what I did:
I cut the line(s) where execution was breaking.
Ran the macro again (it didn't break this time)
Pasted the line(s) again.
It worked for me, when no other key combination (onscreen or physical) worked. Hope it helps someone!
None of the above answers work for me.
I did how ever find this, it's not perfect since you need to keep ALT pressed and then a keys twice. On top of that it's depended on what language your Excel is set to.
In an English Excel you'd use ALT + R + R in German you need to use ALT + U + R
I have a Japanese Layout keyboard. I neither have a scroll lock nor a break on my laptop-Lenovo E470.
A long press on the Esc key worked as a terminator for me.
I found a way round this, opened another instance of Excel and another spreadsheet, then opened the VBA editor from there and it showed as "running" so I could click the stop button
Because all of the above werent working for my application, I ended up writing a VBS script which I can run from the terminal. Not elegant. Probably not the first choice if one of the others work. But, effective.
break.vbs
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "^%{BREAK}"