Word problem (?)

pejgan

New Member
Hi,

I'm opening up a simple .txt file in msWord with pagebreaks. Great. The problem is that Word annoyingly enough opens it in "normal"- view mode (don't know the exact names in english versions, using swedish version).

Due to that, the pagebreaks are only visible as dotted lines in the pages, and therefore the user keeps telling me that the pagebreaks are wrong... If you print the report it looks right, since the only problem is the view-mode.


Does anyone know how to make word open the document in "page layout"-mode?
As for now I'm opening the file with a simple shellexecute-command and I was hoping I didn't have to use anything else if it's possible.


Thanks !
/Pejgan
 

Matthew Scott

New Member
Try this:

DEF VAR ch-word AS COM-HANDLE.

CREATE "Word.Application" ch-word.

/*ch-word:VISIBLE = TRUE.*/

ch-word:documents:Open("c:\hello.txt").
ch-word:ActiveDocument:printPreview.

/*This command closes Word when ready*/
ch-word:Application:Quit.

This works with Word 97, I don't know about any other version. If you need anything else, create a macro on Word and study the VB behind it.
 

pejgan

New Member
*lol*

That's ok. I'm not totally stupid *lol*

Worked fine, just had to change som tiny things:

DEF VAR ch-word AS COM-HANDLE.
CREATE "word.application" ch-word.
ch-word:VISIBLE = TRUE.
ch-word:documents:OPEN("c:/temp/sql.txt").
ch-word:ActiveWindow:view:TYPE =3.

Actually never had to work with these kinds of objekts in Progress before (ok, so I have'nt been working that long..)

but when you mentioned it my earlier VB-experience hit me in the head and I felt sooo studid =)

Thank you!! *1000 hugs*

/Pejgan
 
Top