Word Automation - Printout a specified range

dannoedannoe Member Posts: 3
Hello,

i've got a Problem:

I open a template, change something in the template and then I print the changed template.
The template is seperated in 2 sections, and I want the printer to print only the second section. (last section)

I tried this:
wrdDoc	;Automation;'Microsoft Word 12.0 Object Library'.Document
wrdSections;Automation;'Microsoft Word 12.0 Object Library'.Sections	
wrdSection	;Automation;'Microsoft Word 12.0 Object Library'.Section	
wrdRange	;Automation;'Microsoft Word 12.0 Object Library'.Range	


wrdSections := wrdDoc.Sections;
wrdSection := wrdSections.Last;
wrdRange := wrdSection.Range;

wrdDoc.PrintOut(test0,test0,wrdRange);

But it doesn't seem to work. I look forward to any suggestions you can give me.

Thanks
Daniel

Answers

  • SogSog Member Posts: 1,023
    I suggest you search a community into word automation. Although there are ppl here that know Word automation, the chance is low they can help you with your specific question (I know I can't)
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • dannoedannoe Member Posts: 3
    I've got it.
    wrdSections := wrdDoc.Sections;
    Background := 1;
    Append := 0; 
    Range :=  3;
    OutputFileName := '';
    From := 'p1s' + FORMAT(wrdSections.Count);
    wrdDoc.PrintOut(Background,Append,Range,OutputFileName,From);
    

    Prints all pages from the last section.
Sign In or Register to comment.