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 

Insterting page breaks into MSWord.

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



Joined: 04 Apr 2008
Posts: 3

PostPosted: Fri Apr 04, 2008 11:41 pm    Post subject: Insterting page breaks into MSWord. Reply with quote

I've started becoming rather proficient with AutoHotkey, but I'm having troubles getting a page break into MSWord.

The situation is as follows, I am taking a block text from a .txt document and fileappending it straight to a .doc file which I create using AHK. While this works for one block of text, I would like this to be looped for many blocks of text that are separated by a new page.

I have tried using AHK to open the document in word, read a block of text, send the block of text, then send ^{enter}, and manually break the page. While I get all the text (except for the # sign...which is confusing, but oh well), I lose a bit of the formating I wish to keep. Some of the text is indented and some is not. Using the Send command with FileRead or a Read_Line loop just is not preserving the indentations that I need.

I've been racking my brain, and I can't seem to come up with a solution that doesn't involve me learning how to write a printer driver.
Back to top
View user's profile Send private message AIM Address
gimpalimpa



Joined: 04 Apr 2008
Posts: 3

PostPosted: Sat Apr 12, 2008 7:27 pm    Post subject: Reply with quote

One bump, then I'll let this die.
Back to top
View user's profile Send private message AIM Address
edu



Joined: 12 Oct 2006
Posts: 88
Location: Canada

PostPosted: Sat Apr 12, 2008 8:04 pm    Post subject: Reply with quote

You could give more details on what you're doing. As far as I know, AHK cannot create a MS Word file. It can create a file with the extension *.doc, but it is simply a plain text file.
One solution would be to study a little bit of the Rtf specs. and find out what code it uses to represent a page break, then append that code in all new text you insert in you *.rtf file.
Rtf is a plain text file not a binary like ms word doc. So manipulating text becomes easy.

I hope this helps, I'm very limited in my autohotkey skills to help you more.
_________________
The best things of life are free.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   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