Yanick,
Though my code style is not like yours I just tested it with your code adding :
oRange.InsertBreak()
oWord.Visible = .t.
at the end. I don't see page 1 as empty. What I see is :
(Page1)Fake Text...
-Page break-
(Page2)
Cetin
>Cetin,
>
>the piece of code you provided actually inserts a page before the page we are sitting on, that is, text on page 1 becomes page 2 and page 1 [after your command] becomes blank thus having a 2 page document with page 1 being blank and text on page 2.
>
>As opposed to the behavior I'm looking for, that is, text on page 1 remains there and page inserted becomes page 2 and is blank thus having a 2 page document with text on page 1 and page 2 being blank.
>
>Thanks,
>
>Yanick
>
>>Sorry I don't understand the difference from [Ctrl+Enter] behaviour.
>>Cetin
>>
>>>Thanks Cetin,
>>>
>>>that's almost it...
>>>
>>>
>>>oRange.InsertBreak()
>>>
>>>
>>>IT inserts a pagebreak that is thru but I actually need it to be appended... I need the exact same behavior than [CTRL+ENTER] that is having the new page inserted after the end of the document.
>>>
>>>TIA
>>>
>>>Yanick
>>>
>>>>>Hi again,
>>>>>
>>>>>I need to add a new page to an existing Word Document.
>>>>>
>>>>>
>>>>>#DEFINE wdCollapseEnd 0
>>>>>
>>>>>oWord = CREATEOBJ("Word.Application")
>>>>>oDoc = oWord.documents.Add()
>>>>>oRange = oDoc.range()
>>>>>oRange.InsertAfter("Fake text...")
>>>>>oRange.Collapse( wdCollapseEnd )
>>>>>
>>>>>
>>>>>from here what I'd like to happen is to add a page as if the user would have keyed
and continue to put text on the page that have just been created.
>>>>>
>>>>>TIA for your help,
>>>>>
>>>>>
>>>>>Yanick
>>>>
>>>>oRange.InsertBreak() && Default is page break
>>>>
>>>>Cetin