 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
upendrasingh
Joined: 20 Nov 2009 Posts: 4
|
Posted: Mon Dec 07, 2009 4:29 pm Post subject: Type text in Word document |
|
|
Dear Friends,
I have a template, and I have create a unique document for many individuals based off this template.
Here is what I want to be able to do after I open the template, and press the command key -
I want the the computer to prompt me "Enter Name:" in the Message Box (or something similar), and I want to be able to type the name of the person in the message box.
After I do that, I want it to automatically type that name in the desired place in the Microsoft Word document. Mail merge is not an option.
Thanks! |
|
| Back to top |
|
 |
Jasdeep
Joined: 09 Nov 2009 Posts: 258
|
Posted: Mon Dec 07, 2009 4:31 pm Post subject: |
|
|
| i think its very easy just create a gui,edit and ask the user to enter his name then get the contents of the edit box via guicontrol and just write this content into the word doc |
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
Posted: Mon Dec 07, 2009 4:47 pm Post subject: |
|
|
it is better to use gui, submit or a simple inputbox. Second, if possible: create a bookmark in the Word document so you can open it, send the shortcut to jump to the bookmark in the word document and send or paste the content from the inputbox.
Look at:
- inputbox
- send
If you already have a file with names, simply fileread and parse the file in a loop:
- FileRead
- Loop, parse, variable... _________________ AHK Wiki FAQ
TF : Text files & strings lib, TF Forum |
|
| Back to top |
|
 |
aaffe
Joined: 17 May 2007 Posts: 1002 Location: Germany - Deutschland
|
Posted: Mon Dec 07, 2009 4:58 pm Post subject: |
|
|
Something to start with. Press F1
| Code: |
F1::
InputBox,Name,Fill in the name:,Please give me a name:,,,140,,,,,Gonzo
If ErrorLevel
Return
Send,%Name%
Return
|
|
|
| Back to top |
|
 |
upendrasingh
Joined: 20 Nov 2009 Posts: 4
|
Posted: Mon Dec 07, 2009 5:08 pm Post subject: |
|
|
Thanks! That works for the first part...a window appears, where I can now type the text.
However, in the word document, the text is pasted where the cursor is.
I want to have control over the location of the text by specifying the coordinates.
Any suggestions for that? Codes would help, as I am very new to this.
Thanks in advance.
| aaffe wrote: | Something to start with. Press F1
| Code: |
F1::
InputBox,Name,Fill in the name:,Please give me a name:,,,140,,,,,Gonzo
If ErrorLevel
Return
Send,%Name%
Return
|
|
|
|
| Back to top |
|
 |
upendrasingh
Joined: 20 Nov 2009 Posts: 4
|
Posted: Thu Dec 10, 2009 3:46 pm Post subject: |
|
|
Thanks! That works for the first part...a window appears, where I can now type the text.
However, in the word document, the text is pasted where the cursor is.
I want to have control over the location of the text by specifying the coordinates.
Any suggestions for that? Codes would help, as I am very new to this.
Thanks in advance. |
|
| Back to top |
|
 |
None
Joined: 28 Nov 2009 Posts: 3086
|
Posted: Thu Dec 10, 2009 3:55 pm Post subject: |
|
|
| You don't need Ahk. Put a word like @@@ where you want the name then do a Find/Replace, and Replace @@@ with John Smith |
|
| Back to top |
|
 |
aaffe
Joined: 17 May 2007 Posts: 1002 Location: Germany - Deutschland
|
Posted: Fri Dec 11, 2009 8:54 am Post subject: |
|
|
Or just use Click, x-Position, y-Position to click at the area to paste the text.
| upendrasingh wrote: | Thanks! That works for the first part...a window appears, where I can now type the text.
However, in the word document, the text is pasted where the cursor is.
I want to have control over the location of the text by specifying the coordinates.
Any suggestions for that? Codes would help, as I am very new to this.
Thanks in advance. |
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|