AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Type text in Word document

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
upendrasingh



Joined: 20 Nov 2009
Posts: 4

PostPosted: Mon Dec 07, 2009 4:29 pm    Post subject: Type text in Word document Reply with quote

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
View user's profile Send private message
Jasdeep



Joined: 09 Nov 2009
Posts: 258

PostPosted: Mon Dec 07, 2009 4:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Mon Dec 07, 2009 4:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
aaffe



Joined: 17 May 2007
Posts: 1002
Location: Germany - Deutschland

PostPosted: Mon Dec 07, 2009 4:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
upendrasingh



Joined: 20 Nov 2009
Posts: 4

PostPosted: Mon Dec 07, 2009 5:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
upendrasingh



Joined: 20 Nov 2009
Posts: 4

PostPosted: Thu Dec 10, 2009 3:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
None



Joined: 28 Nov 2009
Posts: 3086

PostPosted: Thu Dec 10, 2009 3:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
aaffe



Joined: 17 May 2007
Posts: 1002
Location: Germany - Deutschland

PostPosted: Fri Dec 11, 2009 8:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group