Strange Problem w/ Margins when publishing to Word

apryor

Registered User.
Local time
Today, 09:45
Joined
Feb 11, 2005
Messages
31
Hey everyone, I tried doing a search for this, but had no luck.

When I export a report to MS Word, Word cuts off some of my data on the due to a problem with the margins. I've checked the margins under "page setup" in Access as well as in Word, but for whatever reason, Word won't use the new margin settings. As always, thanks in advance for your help.

Should Be:
Top: .5"
Bottom: .5"
Left: 1"
Right: .5"

Comes out as:
Top: 1"
Bottom: 1"
Left: 1"
Right: 1"
 
Using Access automation, after sending the report to rtf, have access open in word, change the margins, and then save/close.

I do the same formatting for excel templates that access can't format for printing.

try something similar in word to

Code:
Private Sub BlankTemplate_Click()

    DoCmd.OutputTo acOutputQuery, "blankTemplate", acFormatXLS, pstrAppPath & "\BlankTemplate.xls", False

On Error Resume Next
    'Check to See if Excel is started, if not, start it
Set xl = GetObject(, "excel.application")
    If Err.Number <> 0 Then
        Err.Clear
        Set xl = CreateObject("Excel.Application")
    ElseIf Err.Number = 0 Then
        ' Use Excel that is Started
    End If

xl.Visible = False
Set wb = xl.Workbooks.Open(pstrAppPath & "\BlankTemplate.xls")
Set sh1 = wb.Worksheets("blankTemplate")

wb.Activate
sh1.Activate
    With wb.ActiveSheet.PageSetup
        .PrintTitleRows = "$1:$1"
        .PrintTitleColumns = ""
        .PrintArea = "$A$2:$H$1400"
        .LeftHeader = ""
        .CenterHeader = ""
        .RightHeader = ""
        .LeftFooter = ""
        .CenterFooter = ""
        .RightFooter = ""
        .LeftMargin = 0.25
        .RightMargin = 0.25
        .TopMargin = 0.25
        .BottomMargin = 0.25
        .HeaderMargin = 0.25
        .FooterMargin = 0.25
        .PrintHeadings = False
        .PrintGridlines = False
'        .PrintComments = xlPrintNoComments
        .PrintQuality = 600
        .CenterHorizontally = False
        .CenterVertically = False
'        .Orientation = xlPortrait
        .Draft = False
'        .PaperSize = xlPaperLetter
'        .FirstPageNumber = xlAutomatic
'        .Order = xlDownThenOver
        .BlackAndWhite = False
        .Zoom = False
        .FitToPagesWide = 1
        .FitToPagesTall = 100
'        .PrintErrors = xlPrintErrorsDisplayed
    End With
wb.Save
DoEvents
Set sh1 = Nothing
Set wb = Nothing
xl.Quit
Set xl = Nothing

    MsgBox "To print the Blank Template" + vbCrLf + vbLf + "In the same folder as Inventory.mdb, Open ''BlankTemplate.xls''", vbInformation, "EXCEL FORMATTING DONE"


Exit_BlankTemplate:
    Set sh1 = Nothing
    Set wb = Nothing
    Set xl = Nothing
    DoCmd.SetWarnings True
    DoCmd.Hourglass False
    
End Sub

sportsguy
 
Follow Up Question Regarding Margins

Hey everyone, I tried doing a search for this, but had no luck.

When I export a report to MS Word, Word cuts off some of my data on the due to a problem with the margins. I've checked the margins under "page setup" in Access as well as in Word, but for whatever reason, Word won't use the new margin settings. As always, thanks in advance for your help.

Should Be:
Top: .5"
Bottom: .5"
Left: 1"
Right: .5"

Comes out as:
Top: 1"
Bottom: 1"
Left: 1"
Right: 1"

I have an Access Report on a central server, which client machines have a shortcut to.

On some machines, the report prints out as expected, but on other machines there is data missing.

The report is set to open up automatically in word. When I go into the Report itself, it is correct on all machines.

After exploring the rtf document that is output on both machines, I find only one difference and I can't figure out how to update it.

The machine that prints out correctly shows with a format of:

Paragraph
Spacing
Before: 54.25 pt

The machine that prints out missing data, at the point where the data is missing, the next paragraph heading instead has:

Paragraph
Spacing
Before: 40.05

I am assuming the issue is there is some setting on these machines defaulting to this difference.

Any help would be greatly appreciated, either in getting these to match on both machines, or the larger general issue.

Thanks,

Note: All machines in question are using Access 2003 SP3 and have Word 2003 SP3
 

Users who are viewing this thread

Back
Top Bottom