Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jan 2002
    Location
    Melton Mowbray, UK
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Papersize – parameters in a macro. (Word 2002)

    When I record swapping paper size between the European A4 and the US Letter in a macro the parameters from Page Setup for A4 are:-
    .PageWidth = CentimetersToPoints(21)
    .PageHeight = CentimetersToPoints(29.69)
    and for Letter are:-
    .PageWidth = CentimetersToPoints(21.59)
    .PageHeight = CentimetersToPoints(27.94)

    These appear to be overridden by the printer commands but when I attempt to record a macro using Print/Propeties/Advanced/Paper Output and swap between A4 and Letter the only parameters that seem to have anything to do with papersize are:-
    PrintZoomPaperWidth:=0
    PrintZoomPaperHeight:=0
    These are given as 0, whether I am going from A4 to Letter or back again. If I change via the Print/Propeties/Advanced/Paper Output dialogue box my instructions are accepted.

    I would be pleased if you could let me know what VB parameters control paper size in the Print group.

    Regards
    Tony
    Tony Beckett - Rutland, UK

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Papersize

    Sometimes, the macro recorder doesn't do a very good job - it records too much or too little, or not what you need. Actually, setting paper size is very easy:

    ActiveDocument.PageSetup.PaperSize = wdPaperLetter

    ActiveDocument.PageSetup.PaperSize = wdPaperA4

    There is another setting involved here: in the Print tab of Tools | Options..., there is a check box to allow Word to switch between Letter and A4 automatically, depending on the printer setting. If this is on, you do not need any code to switch paper size.

    If you need to turn the setting off using code, it can be done like this:

    Options.MapPaperSize = False

  3. #3
    Star Lounger
    Join Date
    Jan 2002
    Location
    Melton Mowbray, UK
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Papersize – parameters in a macro. (Word 2002)

    Thanks Hans for the swift response, exactly what I was after.

    Regards
    Tony

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •