How to add page to WORD doc using automation?

H

henry

hi everyone:

I want to write my data to WORD and save as *.doc. Now I can write text and
picture to the first page of the document. But I don't know how to add one
page and write to the page added.

I am using WORD automation to implement this tool.

can some one help me?

wangshy
(e-mail address removed)
 
C

Cheryl Fischer

The following should work:

Selection.InsertBreak Type:=wdPageBreak

When I am not sure of the Word VBA syntax to use in Automation, I cheat -
opening a Word doc and recording the keystrokes that I would use to do the
task manually as a macro. Then, I stop the macro and see what it produced
by opening the macro in edit view.

hth,
 
H

henry

Cheryl:

It really works, thanks

wangshy

Cheryl Fischer said:
The following should work:

Selection.InsertBreak Type:=wdPageBreak

When I am not sure of the Word VBA syntax to use in Automation, I cheat -
opening a Word doc and recording the keystrokes that I would use to do the
task manually as a macro. Then, I stop the macro and see what it produced
by opening the macro in edit view.

hth,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top