Sign in to follow this  
Followers 0
sigil

Controlling Overtype in MS Word

3 posts in this topic

I have a script that collects data from a terminal application and writes that information to an MS Word document. Because of the Word document's format, the data must be written in the Overtype mode (the mode that Word goes into when you press the Insert key). Some of the data writes properly, but certain strings automatically turn off Overtype. Maybe they have a hidden character that automatically turns Overtype off, regardless of whether it's already on or off. This code:

send("{ins}"&$mystring&"{ins}")

hasn't worked.

What I want to do:

I want to make sure that Overtype turns on before I send the string, and turns off after the string writes to Word.

Share this post


Link to post
Share on other sites



Could be special characters in your string.

Try this:

Send("{INS}")
Send($mystring, 1)
Send("{INS}")

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

It could be that Word is protective of your data. Send is a window related command that might take extra time to execute. Try this in your loop and if it seems to help, as little as 400 ms might be enough time:

send("{ins}"&$mystring&"{ins}")
sleep(3000)

But if the problem is a special character, does the text that you are entering include a lot of special characters or is it a common problem, about as common as @CRLF when @CR or @LF might better do.


Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0