Guest Menno Hershberger Posted September 21, 2007 Posted September 21, 2007 I need to set up a simple macro that will input "######" (a 6 number sequence) with one keystroke. I've run into a situation where I need to type every phone number in town into a form... along with related info. It has to be the full 10 digit number with area code and prefix. So the first 6 numbers will always be the same. I'd like to just hit like F7 or something to input the first 6 numbers and then just type in the remaining 4. This would have to be a Windows thing because the specialized software we're using doesn't have any provisions for hotkeys. I used to set up stuff like that in DOS, but don't have a clue about how to do it in Windows. Can anybody help? -- --- Long live Fat32! ---
Guest RJK Posted September 21, 2007 Posted September 21, 2007 Re: Macro question Read up (Google) on the "Windows Scripting Host" regards, Richard "Menno Hershberger" <mhersh22@nosuchplace.net> wrote in message news:Xns99B2359F92075butter@wefb973cbe498... >I need to set up a simple macro that will input "######" (a 6 number > sequence) with one keystroke. > I've run into a situation where I need to type every phone number in town > into a form... along with related info. It has to be the full 10 digit > number with area code and prefix. So the first 6 numbers will always be > the > same. > I'd like to just hit like F7 or something to input the first 6 numbers and > then just type in the remaining 4. > This would have to be a Windows thing because the specialized software > we're using doesn't have any provisions for hotkeys. > I used to set up stuff like that in DOS, but don't have a clue about how > to > do it in Windows. > Can anybody help? > > -- > --- Long live Fat32! ---
Guest Pegasus \(MVP\) Posted September 21, 2007 Posted September 21, 2007 Re: Macro question "Menno Hershberger" <mhersh22@nosuchplace.net> wrote in message news:Xns99B2359F92075butter@wefb973cbe498... >I need to set up a simple macro that will input "######" (a 6 number > sequence) with one keystroke. > I've run into a situation where I need to type every phone number in town > into a form... along with related info. It has to be the full 10 digit > number with area code and prefix. So the first 6 numbers will always be > the > same. > I'd like to just hit like F7 or something to input the first 6 numbers and > then just type in the remaining 4. > This would have to be a Windows thing because the specialized software > we're using doesn't have any provisions for hotkeys. > I used to set up stuff like that in DOS, but don't have a clue about how > to > do it in Windows. > Can anybody help? > > -- > --- Long live Fat32! --- You could create the file c:\windows\Prefix.vbs and put these lines inside: Set ws=CreateObject("WScript.Shell") ws.AppActivate("YourAppName") ws.sendkeys("111222") YourAppName is the name of your application, e.g. Microsoft Excel - Book1. Just check what it says in the Title Bar when the application is open. Now create a shortcut on the desktop with these properties: Target = cscript.exe c:\windows\Prefix.vbs Shortcut key = F7
Guest Pegasus \(MVP\) Posted September 21, 2007 Posted September 21, 2007 Re: Macro question "RJK" <notatospam@hotmail.com> wrote in message news:%23j24W1D$HHA.1900@TK2MSFTNGP02.phx.gbl... > Read up (Google) on the "Windows Scripting Host" > > regards, Richard > That's a pretty tall order for a beginner . . .
Guest RJK Posted September 21, 2007 Posted September 21, 2007 Re: Macro question Really ? ...that's what I had to do when I wanted to make a Windows macro. i.e. there's hundreds of tutorials out there, that lead you through making a Windows macro, which meant I had to find out a few odds and ends about the Windows scripting host ! ...and as with EVERYTHING to do with a PC whether it be hardware or software, time WHISTLES past. It took the odd half hour or so, and a bit of trial and error ...mind you it was so long ago I'd have toread up on it all again ! :-) regards, Richard "Pegasus (MVP)" <I.can@fly.com> wrote in message news:e1yPv8D$HHA.1416@TK2MSFTNGP03.phx.gbl... > > "RJK" <notatospam@hotmail.com> wrote in message > news:%23j24W1D$HHA.1900@TK2MSFTNGP02.phx.gbl... >> Read up (Google) on the "Windows Scripting Host" >> >> regards, Richard >> > > That's a pretty tall order for a beginner . . . >
Guest Pegasus \(MVP\) Posted September 21, 2007 Posted September 21, 2007 Re: Macro question If it took you only half an hour to get into VB Scripts as a beginner then you must be a genius. Congratulations! "RJK" <notatospam@hotmail.com> wrote in message news:eakfOZE$HHA.3780@TK2MSFTNGP06.phx.gbl... > Really ? ...that's what I had to do when I wanted to make a Windows > macro. i.e. there's hundreds of tutorials out there, that lead you through > making a Windows macro, which meant I had to find out a few odds and ends > about the Windows scripting host ! ...and as with EVERYTHING to do with a > PC whether it be hardware or software, time WHISTLES past. It took the > odd half hour or so, and a bit of trial and error ...mind you it was so > long ago I'd have toread up on it all again ! :-) > > regards, Richard > > > "Pegasus (MVP)" <I.can@fly.com> wrote in message > news:e1yPv8D$HHA.1416@TK2MSFTNGP03.phx.gbl... >> >> "RJK" <notatospam@hotmail.com> wrote in message >> news:%23j24W1D$HHA.1900@TK2MSFTNGP02.phx.gbl... >>> Read up (Google) on the "Windows Scripting Host" >>> >>> regards, Richard >>> >> >> That's a pretty tall order for a beginner . . . >> > >
Guest RJK Posted September 21, 2007 Posted September 21, 2007 Re: Macro question ...alright, ...several half hours or so ! ....and I was a genius but, nowadays I seem to be forgetting more than I can remember :-) ....and I did own up the fact that I can't remember how to make a Windows macro, but, I could remember how I found out how to make one a long time ago ! :-) regards, Richard "Pegasus (MVP)" <I.can@fly.com> wrote in message news:uvzWNmE$HHA.4732@TK2MSFTNGP04.phx.gbl... > If it took you only half an hour to get into VB Scripts as a beginner > then you must be a genius. Congratulations! > > > "RJK" <notatospam@hotmail.com> wrote in message > news:eakfOZE$HHA.3780@TK2MSFTNGP06.phx.gbl... >> Really ? ...that's what I had to do when I wanted to make a Windows >> macro. i.e. there's hundreds of tutorials out there, that lead you >> through making a Windows macro, which meant I had to find out a few odds >> and ends about the Windows scripting host ! ...and as with EVERYTHING to >> do with a PC whether it be hardware or software, time WHISTLES past. It >> took the odd half hour or so, and a bit of trial and error ...mind you >> it was so long ago I'd have toread up on it all again ! :-) >> >> regards, Richard >> >> >> "Pegasus (MVP)" <I.can@fly.com> wrote in message >> news:e1yPv8D$HHA.1416@TK2MSFTNGP03.phx.gbl... >>> >>> "RJK" <notatospam@hotmail.com> wrote in message >>> news:%23j24W1D$HHA.1900@TK2MSFTNGP02.phx.gbl... >>>> Read up (Google) on the "Windows Scripting Host" >>>> >>>> regards, Richard >>>> >>> >>> That's a pretty tall order for a beginner . . . >>> >> >> > >
Guest Bob I Posted September 21, 2007 Posted September 21, 2007 Re: Macro question any reason to not "copy" the the first 6 digits and then "paste" them using Ctrl-V or Shift Insert? Menno Hershberger wrote: > I need to set up a simple macro that will input "######" (a 6 number > sequence) with one keystroke. > I've run into a situation where I need to type every phone number in town > into a form... along with related info. It has to be the full 10 digit > number with area code and prefix. So the first 6 numbers will always be the > same. > I'd like to just hit like F7 or something to input the first 6 numbers and > then just type in the remaining 4. > This would have to be a Windows thing because the specialized software > we're using doesn't have any provisions for hotkeys. > I used to set up stuff like that in DOS, but don't have a clue about how to > do it in Windows. > Can anybody help? >
Guest Menno Hershberger Posted September 21, 2007 Posted September 21, 2007 Re: Macro question After the number is entered, there are several other fields that I use copy and paste on, so by the next time I'm ready to enter a number, it would be out of the clipboard. But now that you mention it, I remember a program called ClipMate that saves previous clipboard contents. If there were a fast way to restore that number in the clipboard, I'd go for that. I'm going to try Pegasus's idea first. Bob I <birelan@yahoo.com> wrote in news:OXxUMjF$HHA.4956@TK2MSFTNGP06.phx.gbl: > any reason to not "copy" the the first 6 digits and then "paste" them > using Ctrl-V or Shift Insert? > > Menno Hershberger wrote: > >> I need to set up a simple macro that will input "######" (a 6 number >> sequence) with one keystroke. >> I've run into a situation where I need to type every phone number in >> town into a form... along with related info. It has to be the full 10 >> digit number with area code and prefix. So the first 6 numbers will >> always be the same. >> I'd like to just hit like F7 or something to input the first 6 >> numbers and then just type in the remaining 4. >> This would have to be a Windows thing because the specialized >> software we're using doesn't have any provisions for hotkeys. >> I used to set up stuff like that in DOS, but don't have a clue about >> how to do it in Windows. >> Can anybody help? >> > > -- --- Long live Fat32! ---
Guest Menno Hershberger Posted September 21, 2007 Posted September 21, 2007 Re: Macro question "Pegasus \(MVP\)" <I.can@fly.com> wrote in news:e#i9$3D$HHA.4828@TK2MSFTNGP04.phx.gbl: > > "Menno Hershberger" <mhersh22@nosuchplace.net> wrote in message > news:Xns99B2359F92075butter@wefb973cbe498... >>I need to set up a simple macro that will input "######" (a 6 number >> sequence) with one keystroke. >> I've run into a situation where I need to type every phone number in >> town into a form... along with related info. It has to be the full 10 >> digit number with area code and prefix. So the first 6 numbers will >> always be the >> same. >> I'd like to just hit like F7 or something to input the first 6 >> numbers and then just type in the remaining 4. >> This would have to be a Windows thing because the specialized >> software we're using doesn't have any provisions for hotkeys. >> I used to set up stuff like that in DOS, but don't have a clue about >> how to >> do it in Windows. >> Can anybody help? >> >> -- >> --- Long live Fat32! --- > > You could create the file c:\windows\Prefix.vbs > and put these lines inside: > > Set ws=CreateObject("WScript.Shell") > ws.AppActivate("YourAppName") > ws.sendkeys("111222") > > YourAppName is the name of your application, e.g. > Microsoft Excel - Book1. Just check what it says in > the Title Bar when the application is open. > > Now create a shortcut on the desktop with these properties: > > Target = cscript.exe c:\windows\Prefix.vbs > Shortcut key = F7 You're my hero! It took a little playing around with YourAppName but when I finally got it right, it worked like a charm. Thanks! -- --- Long live Fat32! ---
Guest Pegasus \(MVP\) Posted September 21, 2007 Posted September 21, 2007 Re: Macro question "Menno Hershberger" <mhersh22@nosuchplace.net> wrote in message news:Xns99B26D74EA228butter@wefb973cbe498... > "Pegasus \(MVP\)" <I.can@fly.com> wrote in > news:e#i9$3D$HHA.4828@TK2MSFTNGP04.phx.gbl: > >> >> "Menno Hershberger" <mhersh22@nosuchplace.net> wrote in message >> news:Xns99B2359F92075butter@wefb973cbe498... >>>I need to set up a simple macro that will input "######" (a 6 number >>> sequence) with one keystroke. >>> I've run into a situation where I need to type every phone number in >>> town into a form... along with related info. It has to be the full 10 >>> digit number with area code and prefix. So the first 6 numbers will >>> always be the >>> same. >>> I'd like to just hit like F7 or something to input the first 6 >>> numbers and then just type in the remaining 4. >>> This would have to be a Windows thing because the specialized >>> software we're using doesn't have any provisions for hotkeys. >>> I used to set up stuff like that in DOS, but don't have a clue about >>> how to >>> do it in Windows. >>> Can anybody help? >>> >>> -- >>> --- Long live Fat32! --- >> >> You could create the file c:\windows\Prefix.vbs >> and put these lines inside: >> >> Set ws=CreateObject("WScript.Shell") >> ws.AppActivate("YourAppName") >> ws.sendkeys("111222") >> >> YourAppName is the name of your application, e.g. >> Microsoft Excel - Book1. Just check what it says in >> the Title Bar when the application is open. >> >> Now create a shortcut on the desktop with these properties: >> >> Target = cscript.exe c:\windows\Prefix.vbs >> Shortcut key = F7 > > You're my hero! > It took a little playing around with YourAppName but when I finally got > it right, it worked like a charm. > Thanks! > Glad it worked for you, and thanks for the feedback.
Guest Newbie Coder Posted September 21, 2007 Posted September 21, 2007 Re: Macro question Pegasus, Technically the OP asked for a macro which is VBA not VBS ----------------- Send keys won't work if the focus is removed The user has a text field & if there are multiple text fields/controls then you will need to tab to that control first. So, if the OP launches his application & EXIT is the default then your sendkeys will be trying to type into a button, which isn't going to work -- Newbie Coder (It's just a name) "Pegasus (MVP)" <I.can@fly.com> wrote in message news:e%23i9$3D$HHA.4828@TK2MSFTNGP04.phx.gbl... > > "Menno Hershberger" <mhersh22@nosuchplace.net> wrote in message > news:Xns99B2359F92075butter@wefb973cbe498... > >I need to set up a simple macro that will input "######" (a 6 number > > sequence) with one keystroke. > > I've run into a situation where I need to type every phone number in town > > into a form... along with related info. It has to be the full 10 digit > > number with area code and prefix. So the first 6 numbers will always be > > the > > same. > > I'd like to just hit like F7 or something to input the first 6 numbers and > > then just type in the remaining 4. > > This would have to be a Windows thing because the specialized software > > we're using doesn't have any provisions for hotkeys. > > I used to set up stuff like that in DOS, but don't have a clue about how > > to > > do it in Windows. > > Can anybody help? > > > > -- > > --- Long live Fat32! --- > > You could create the file c:\windows\Prefix.vbs > and put these lines inside: > > Set ws=CreateObject("WScript.Shell") > ws.AppActivate("YourAppName") > ws.sendkeys("111222") > > YourAppName is the name of your application, e.g. > Microsoft Excel - Book1. Just check what it says in > the Title Bar when the application is open. > > Now create a shortcut on the desktop with these properties: > > Target = cscript.exe c:\windows\Prefix.vbs > Shortcut key = F7 > >
Guest Menno Hershberger Posted September 23, 2007 Posted September 23, 2007 Re: Macro question 25 years ago, I was the one who figured stuff out for myself and answered questions for other people. Now, at 70, I've absorbed about all the knowledge I can stand. I'm not too proud anymore to ask help from someone who already has something figured out. I just read something somewhere to the effect that the reason old people get forgetful is that because the older you get, the more stuff you have to remember... :-) "RJK" <notatospam@hotmail.com> wrote in news:OQTEwrE$HHA.4828@TK2MSFTNGP04.phx.gbl: > ..alright, ...several half hours or so ! > ...and I was a genius but, nowadays I seem to be forgetting more than > I can remember :-) > ...and I did own up the fact that I can't remember how to make a > Windows macro, but, I could remember how I found out how to make one a > long time ago ! :-) > > regards, Richard > > > "Pegasus (MVP)" <I.can@fly.com> wrote in message > news:uvzWNmE$HHA.4732@TK2MSFTNGP04.phx.gbl... >> If it took you only half an hour to get into VB Scripts as a beginner >> then you must be a genius. Congratulations! >> >> >> "RJK" <notatospam@hotmail.com> wrote in message >> news:eakfOZE$HHA.3780@TK2MSFTNGP06.phx.gbl... >>> Really ? ...that's what I had to do when I wanted to make a Windows >>> macro. i.e. there's hundreds of tutorials out there, that lead you >>> through making a Windows macro, which meant I had to find out a few >>> odds and ends about the Windows scripting host ! ...and as with >>> EVERYTHING to do with a PC whether it be hardware or software, time >>> WHISTLES past. It took the odd half hour or so, and a bit of trial >>> and error ...mind you it was so long ago I'd have toread up on it >>> all again ! :-) >>> >>> regards, Richard >>> >>> >>> "Pegasus (MVP)" <I.can@fly.com> wrote in message >>> news:e1yPv8D$HHA.1416@TK2MSFTNGP03.phx.gbl... >>>> >>>> "RJK" <notatospam@hotmail.com> wrote in message >>>> news:%23j24W1D$HHA.1900@TK2MSFTNGP02.phx.gbl... >>>>> Read up (Google) on the "Windows Scripting Host" >>>>> >>>>> regards, Richard >>>>> >>>> >>>> That's a pretty tall order for a beginner . . . >>>> >>> >>> >> >> > > -- --- Long live Fat32! ---
Guest Ken Blake, MVP Posted September 23, 2007 Posted September 23, 2007 Re: Macro question On Sun, 23 Sep 2007 08:27:07 -0700, Menno Hershberger <mhersh22@nosuchplace.net> wrote: > 25 years ago, I was the one who figured stuff out for myself and answered > questions for other people. Now, at 70, I've absorbed about all the > knowledge I can stand. I am also 70 (or will be in a month and a half), but I haven't stopped learning yet. I hope never to stop until the day I die. > I'm not too proud anymore to ask help from someone > who already has something figured out. I never was. Most of what I know I learned from someone else--in person, in books, on the internet, etc. Comparatively few things can be learned from personal experience (I'm not just talking about computer things here). > I just read something somewhere to the effect that the reason old people > get forgetful is that because the older you get, the more stuff you have > to remember... :-) I can't remember whether I read that or not. ;-) -- Ken Blake, Microsoft MVP Windows - Shell/User Please Reply to the Newsgroup
Guest RJK Posted September 24, 2007 Posted September 24, 2007 Re: Macro question LOL ! ...brilliant, ...I know how you feel ! regards, Richard "Menno Hershberger" <mhersh22@nosuchplace.net> wrote in message news:Xns99B46A5446C06butter@wefb973cbe498... > 25 years ago, I was the one who figured stuff out for myself and answered > questions for other people. Now, at 70, I've absorbed about all the > knowledge I can stand. I'm not too proud anymore to ask help from someone > who already has something figured out. > > I just read something somewhere to the effect that the reason old people > get forgetful is that because the older you get, the more stuff you have > to remember... :-) > > "RJK" <notatospam@hotmail.com> wrote in > news:OQTEwrE$HHA.4828@TK2MSFTNGP04.phx.gbl: > >> ..alright, ...several half hours or so ! >> ...and I was a genius but, nowadays I seem to be forgetting more than >> I can remember :-) >> ...and I did own up the fact that I can't remember how to make a >> Windows macro, but, I could remember how I found out how to make one a >> long time ago ! :-) >> >> regards, Richard >> >> >> "Pegasus (MVP)" <I.can@fly.com> wrote in message >> news:uvzWNmE$HHA.4732@TK2MSFTNGP04.phx.gbl... >>> If it took you only half an hour to get into VB Scripts as a beginner >>> then you must be a genius. Congratulations! >>> >>> >>> "RJK" <notatospam@hotmail.com> wrote in message >>> news:eakfOZE$HHA.3780@TK2MSFTNGP06.phx.gbl... >>>> Really ? ...that's what I had to do when I wanted to make a Windows >>>> macro. i.e. there's hundreds of tutorials out there, that lead you >>>> through making a Windows macro, which meant I had to find out a few >>>> odds and ends about the Windows scripting host ! ...and as with >>>> EVERYTHING to do with a PC whether it be hardware or software, time >>>> WHISTLES past. It took the odd half hour or so, and a bit of trial >>>> and error ...mind you it was so long ago I'd have toread up on it >>>> all again ! :-) >>>> >>>> regards, Richard >>>> >>>> >>>> "Pegasus (MVP)" <I.can@fly.com> wrote in message >>>> news:e1yPv8D$HHA.1416@TK2MSFTNGP03.phx.gbl... >>>>> >>>>> "RJK" <notatospam@hotmail.com> wrote in message >>>>> news:%23j24W1D$HHA.1900@TK2MSFTNGP02.phx.gbl... >>>>>> Read up (Google) on the "Windows Scripting Host" >>>>>> >>>>>> regards, Richard >>>>>> >>>>> >>>>> That's a pretty tall order for a beginner . . . >>>>> >>>> >>>> >>> >>> >> >> > > > > -- > --- Long live Fat32! ---
Guest RJK Posted September 24, 2007 Posted September 24, 2007 Re: Macro question "Comparatively few things can be learned from personal experience (I'm not just talking about computer things here)." For some tenouous reason, your above comment brought to mind the several times, across several days, many years ago, that I stubbornly sat in front of my PC, (with 2 x 5 1/4" floppy drives and no hard-disk), until the "penny-dropped" (for me almost a "Eureka" moment:-), and fought with MSDOS until it "clicked" as to how the damned file storage / directory structure worked !!!! i.e. "tree branch" directories within directories, and files within directories ! ...it was SUCH a relief when that penny dropped ! ....oh happy days ! regards, Richard "Ken Blake, MVP" <kblake@this.is.am.invalid.domain> wrote in message news:40fdf3d5vifprjoc44clgh8k69uqrcbu0b@4ax.com... > On Sun, 23 Sep 2007 08:27:07 -0700, Menno Hershberger > <mhersh22@nosuchplace.net> wrote: > >> 25 years ago, I was the one who figured stuff out for myself and answered >> questions for other people. Now, at 70, I've absorbed about all the >> knowledge I can stand. > > > I am also 70 (or will be in a month and a half), but I haven't stopped > learning yet. I hope never to stop until the day I die. > > >> I'm not too proud anymore to ask help from someone >> who already has something figured out. > > > I never was. Most of what I know I learned from someone else--in > person, in books, on the internet, etc. Comparatively few things can > be learned from personal experience (I'm not just talking about > computer things here). > > >> I just read something somewhere to the effect that the reason old people >> get forgetful is that because the older you get, the more stuff you have >> to remember... :-) > > > > I can't remember whether I read that or not. ;-) > > -- > Ken Blake, Microsoft MVP Windows - Shell/User > Please Reply to the Newsgroup
Recommended Posts