Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Adding a Page Break in Word

Adding a Page Break in Word

Adding a Page Break in Word

I'm scraping info and sending it to a Word doc. I want to be able to send data to Word and then at some point put in a page break and start a new page. It can be in the same doc, just different pages.

I use:

objDoc.Content.InsertAfter Chr$(13  ) & Chr$(10) & Chr$(13) & Chr$(10)
    msgText = "Final transaction reviewed: "& TransId & "."    
    objDoc.Content.InsertAfter MsgText

to send data to the doc and a couple hard returns.
The cursor doesn't move during this process. I can continue to send info and it will put it at the bottom of last data. When I send a page break using: objDoc.Content.InsertBreak
it adds a new page but deletes everything before it. I'm thinking it's because it is doing break at cursor location and I don't know how to move the cursor.  Any ideas??

RE: Adding a Page Break in Word

You obviously know how to code in VBA, I'd suggest you run the code in VBA and use it to control Extra. You'll find the environment more familiar, and the properties and methods are more exposed.

See this FAQ:


RE: Adding a Page Break in Word

I see this suggestion all the time and I think I could do the VBA code, but my thought is always how I would fire the macro then... I usually have a toolbar button in the Extra session that my users click to fire the macros. Would I be able to use those buttons to fire macros in Word? The other problem I have is where to save macros. Do I save the to Normal.dot? If so, how can I distribute that to all my users? Right now it's easy to run a batch file that copies my macros to the macros folder on the C drive. Normal.dot I think resides within each user's templates folder.

RE: Adding a Page Break in Word

So if I were to do it in Excel I would distribute the spreadsheet file that I save the macro in to my users?

My staff does almost all their work on the mainframe so are in Extra 100% of the time. So I do like to have the button to fire the macro in Extra. I suppose I could use an Extra macro to open the spreadsheet and fire the macro?

RE: Adding a Page Break in Word

I usually use Excel, not Word. I save the VBA code in a specific Excel file.

You can set up a button that will do certain things. I'd suggest, however, that you rethink your entire process. The user obviously wants a word document as the end result. Why not have them open a Word doc as step 1, then run a macro from there that conects to Extra, does stuff and outputst the doc?

In most of my cases, the user is blissfully unaware that Extra is churning in the background. They just see the "magic" happening in their Office Doc (ususally Excel).


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close