Re: ouvrir un document word à partir d'un programme cobol
- From: "James J. Gavan" <jgavandeletethis@xxxxxxx>
- Date: Wed, 22 Feb 2006 21:01:37 GMT
2jo wrote:
OK JimmyI'll answer them both in one message. If I don't give you anything here that helps then *definitely* join the Micro Focus Forum posting your questions under Net Express.
Thanks a lot
Now I can do a mass mailing, to do it i use a 'macro' which make the
mass mailing and and i call this macro from my COBOL program
The mass mailing can be send to a printer, to a new document or by
mail... I know how to do this thanks to your help and thanks to forums
My problem now is that I want to change the printer, I try to do this
with COBOL but I'm not able to do this...Have you got some help?
Firstly the macro business. (I'm going purely from memory having used WordPerfect over ten years ago - but NOT with COBOL. Both word processors have similar facilities). I took a very quick look at the MS Word Documentation - lots of examples and I believe sample data files that you can test with. The particular feature you are after is "Mail Merge'
1. Word requires two files, Letter.doc and Addresses.doc both in MS Word format. Having set up those two files, I'm pretty *certain* that Letters.doc has to be given the file-pathname of the file Addresses.doc.
So suggestions.
2. Don't use COBOL - just MS Word; look at a mail merge demo and I *think* if you instruct Letters.doc to print it will automatically reference Addresses.doc.
3. Having got a handle on that. By COBOL program create you own Addresses.doc - I'm using pseudo methods:-
(a) invoke MSWord "open empty" using filename returning MyAddresses.doc (object reference)
(b) From your database, assemble each individual address block of information
(c) invoke MyAddresses.doc (object reference) "insert" using this address-text-string(containing appropriate control codes); repeat Step(c)
(d) invoke MyAddresses.doc "close file"
(e) invoke "open existing-file" using Letters.doc filename returning
MyLetters.doc (object reference)
4. I think you may find that the next step does it -
invoke MyLetters.doc "print" - the repetitious printing is in MyLetters.doc telling it go back and repeatedly reference Addresses.doc
5. I don't remember the terminology but I believe 'Control Codes' When you are typing in MS Word (or WordPerfect for that matter) you can instruct the software to display the control codes for what you have or are currently typing, like page-break, indentations, tabbing, changing style, colour, size, font etc.
Now when I wrote above - "insert" using this address-text-string (containing appropriate control codes), you have to ensure the lines of your address block have the appropriate markers - control codes
> Now I can do a mass mailing, to do it i use a 'macro' which make the
> mass mailing and and i call this macro from my COBOL program
> The mass mailing can be send to a printer, to a new document or by
> mail... I know how to do this thanks to your help and thanks to forums
> My problem now is that I want to change the printer, I try to do this
> with COBOL but I'm not able to do this...Have you got some help?
>
There are PC_PRINT/PRINTER routines but I don't think they are going to help you here as the document to be printed is within MS Word. Check out the routines.
You can set your printer and PC_PRINT_FILE using filename etc. Somehow I don't see it triggering the mail-merge in the MS Word Letters.doc file. If by some extreme luck it does work - then you have an easy solution.
Ask for help in the Forum on changing and identifying printers - there maybe examples but likely they will give you an API routine to do it.
Jimmy
.
- References:
- ouvrir un document word à partir d'un programme cobol
- From: 2jo
- Re: ouvrir un document word à partir d'un programme cobol
- From: James J. Gavan
- Re: ouvrir un document word à partir d'un programme cobol
- From: 2jo
- Re: ouvrir un document word à partir d'un programme cobol
- From: James J. Gavan
- Re: ouvrir un document word à partir d'un programme cobol
- From: 2jo
- ouvrir un document word à partir d'un programme cobol
- Prev by Date: Re: GoTo in Java
- Next by Date: Re: ouvrir un document word à partir d'un programme cobol
- Previous by thread: Re: ouvrir un document word à partir d'un programme cobol
- Next by thread: Source control and directory structure
- Index(es):
Relevant Pages
|