Creating word documents

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eagle

    #1

    Creating word documents

    I am trying to change the linewidth of a page border, and keeping getting an
    error at the "wdLineWith075p t" For some reason, it only accepts the value
    of 24 like the left border. Yet when I print the document that has been
    created, the right border does not print, so I've been trying to put in
    different values and I get an error on all values I've tried other than 24.
    Does anyone have an idea of what I'm doing wrong?

    Dim Word As Object
    Dim rtf As ActiveReportsRT FExport.ARExpor tRTF
    Set Word = CreateObject("w ord.Application ")
    Set rtf = New ActiveReportsRT FExport.ARExpor tRTF
    rtf.FileName = "c:\temp.RT F"
    rep.Run False
    rtf.Export rep.Pages
    Word.Documents. Open rtf.FileName

    With Word.Documents( 1).Sections(1)
    'left border
    .Borders(wdBord erLeft).LineSty le = 9
    .Borders(wdBord erLeft).LineWid th = 24
    .Borders(wdBord erLeft).ColorIn dex = 0

    'right border
    .Borders(wdBord erRight).LineSt yle = 9
    .Borders(wdBord erRight).LineWi dth = wdLineWidth075p t
    .Borders(wdBord erRight).ColorI ndex = 0

    'top border
    .Borders(wdBord erTop).LineStyl e = 9
    .Borders(wdBord erTop).LineWidt h = 24
    .Borders(wdBord erTop).ColorInd ex = 0

    'bottom border
    .Borders(wdBord erBottom).LineS tyle = 9
    .Borders(wdBord erBottom).LineW idth = 24
    .Borders(wdBord erBottom).Color Index = 0

    'all borders
    .Borders.Distan ceFrom = 1
    .Borders.Always InFront = True
    .Borders.Surrou ndHeader = True
    .Borders.Surrou ndFooter = True
    .Borders.JoinBo rders = False
    .Borders.ApplyP ageBordersToAll Sections

    End With
    Word.Visible = True
    UserControl.Mou sePointer = vbDefault
    Set Word = Nothing
    Set rtf = Nothing
    Set rep = Nothing
    End Sub


    Thanks for your help.


Working...