Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-17-2013, 10:45 AM
Isadora Isadora is offline How to resize the image in the header so that it fits the page Windows 7 32bit How to resize the image in the header so that it fits the page Office 2010 32bit
Novice
How to resize the image in the header so that it fits the page
 
Join Date: Mar 2012
Location: Milan, Italy
Posts: 18
Isadora is on a distinguished road
Default How to resize the image in the header so that it fits the page

Hello,

I am working on a macro to insert an image as the header. This image as a box on the border, but when I print the spreadsheet, the "sides" of the box are not printed.

The problem doesn't lie in the printer borders since I have the same letterhead in Word (same size) and the borders are correctly printed.

How can I make sure they are displayed?

Also, the image quality in print is kind of poor. How can I improve that?


The footer is inserted as a text, so the difference is noticeable. My image itself is of the correct quality (taken as a snapshot of the Word letterhead).

This is the code I am using:

Code:
Sub MyLetterhead()

ActiveSheet.PageSetup.CenterHeaderPicture.Filename = _
        "C:\header_macro\header.png"
    With ActiveSheet.PageSetup
        .PrintTitleRows = ""
        .PrintTitleColumns = ""
    End With
  
    ActiveSheet.PageSetup.PrintArea = ""
    With ActiveSheet.PageSetup
        .LeftHeader = ""
        .CenterHeader = "&G"
        .RightHeader = ""
        .LeftFooter = ""
        .CenterFooter = ""
        .RightFooter = ""
        .LeftMargin = Application.CentimetersToPoints(1.9)
        .RightMargin = Application.CentimetersToPoints(0.7)
        .TopMargin = Application.CentimetersToPoints(1.2)
        .BottomMargin = Application.CentimetersToPoints(0.9)
        .HeaderMargin = Application.CentimetersToPoints(0.4)
        .FooterMargin = Application.InchesToPoints(0.2)
        .PrintHeadings = False
        .PrintGridlines = False
        .PrintComments = xlPrintNoComments
        .PrintQuality = 600
        .CenterHorizontally = False
        .CenterVertically = False
        .Orientation = xlPortrait
        .Draft = False
        .PaperSize = xlPaperA4
        .FirstPageNumber = xlAutomatic
        .Order = xlDownThenOver
        .BlackAndWhite = False
        .Zoom = False
        .PrintErrors = xlPrintErrorsDisplayed
        .OddAndEvenPagesHeaderFooter = False
        .DifferentFirstPageHeaderFooter = False
        .ScaleWithDocHeaderFooter = True
        .AlignMarginsHeaderFooter = True
        .EvenPage.LeftHeader.Text = ""
        .EvenPage.CenterHeader.Text = ""
        .EvenPage.RightHeader.Text = ""
        .EvenPage.LeftFooter.Text = ""
        .EvenPage.CenterFooter.Text = ""
        .EvenPage.RightFooter.Text = ""
        .FirstPage.LeftHeader.Text = ""
        .FirstPage.CenterHeader.Text = ""
        .FirstPage.RightHeader.Text = ""
        .FirstPage.LeftFooter.Text = ""
        .FirstPage.CenterFooter.Text = ""
        .FirstPage.RightFooter.Text = ""
        .FitToPagesWide = 1
        .FitToPagesTall = False
    End With
    
End Sub
Reply With Quote
  #2  
Old 08-20-2013, 06:02 AM
Isadora Isadora is offline How to resize the image in the header so that it fits the page Windows 7 32bit How to resize the image in the header so that it fits the page Office 2010 32bit
Novice
How to resize the image in the header so that it fits the page
 
Join Date: Mar 2012
Location: Milan, Italy
Posts: 18
Isadora is on a distinguished road
Default

I figure this out, as well.

The margins of the page must be smaller than the header size, otherwise it will be cut off. It's all matter of fine tuning the margins and the image size.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
right side of table off edge of page, how to resize? erik2000 Word Tables 1 03-29-2013 11:12 AM
How to resize the image in the header so that it fits the page Calendar - Page resize problem Rager Word 1 12-17-2012 02:01 PM
Image proportional resize not functioning! alexfcm PowerPoint 0 09-27-2012 07:22 AM
How to resize the image in the header so that it fits the page 100% opacity on image in header yAnn1ck Word 1 04-05-2012 03:58 PM
How to resize the image in the header so that it fits the page WORD Macro - import picture - resize - position - page break - loop Nano07 Word VBA 2 11-02-2011 05:14 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:09 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft