【问题标题】:Microsoft Word report issue using VB6使用 VB6 的 Microsoft Word 报告问题
【发布时间】:2016-02-02 18:03:21
【问题描述】:

textPositionOFf 我正在用 VB6 构建一个要在 Microsoft Word 中打印的报告。我正在处理现有的报告时看到一些不应该发生的问题。我基本上是在处理一份已创建的报告,我正在制作自己的一份报告。我有一个创建标题的快速函数,我在其中传递参数,主要是标题的行号和文本。

对于应用边框的三行代码,我收到一条错误消息“5941 - 集合的请求成员不存在”我正在查看另一份报告,它看起来与我的完全一样,但我'我得到这个错误。有谁知道可能是什么问题?

Private Sub TableStyle_001_HeaderLine(row As Integer, Col1Txt As String)
  On Error GoTo error_handler:
  w_Doc.Tables.Add w_Rng, 1, 1

  w_Wrd.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
  With w_Wrd.Selection.Tables(w_DocTblIdx).Rows(row)
    With .Shading
        .Texture = wdTextureNone
        .ForegroundPatternColor = wdColorAutomatic
        .BackgroundPatternColor = wdColorGray15
    End With
    With .Borders(wdBorderLeft)
        .LineStyle = wdLineStyleSingle
        .LineWidth = wdLineWidth050pt
        .Color = wdColorAutomatic
    End With
    With .Borders(wdBorderRight)
        .LineStyle = wdLineStyleSingle
        .LineWidth = wdLineWidth050pt
        .Color = wdColorAutomatic
    End With
    With .Borders(wdBorderTop)
        .LineStyle = wdLineStyleSingle
        .LineWidth = wdLineWidth050pt
        .Color = wdColorAutomatic
    End With
    With .Borders(wdBorderBottom)
        .LineStyle = wdLineStyleSingle
        .LineWidth = wdLineWidth050pt
        .Color = wdColorAutomatic
    End With

   .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone 'error here
   .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone 'here
   .Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone   'and here
   .Borders.Shadow = False

  'WRITE THE DATA
    .Cells(1).Select
    w_Wrd.Selection.Font.Bold = True
    w_Wrd.Selection.TypeText Col1Txt


  End With

【问题讨论】:

  • 但是我要等 90 分钟 :(
  • 随着您获得声誉,事情会变得更好 :-) 内置限制是为了让新手有机会学习指南并适应环境。

标签: ms-word vb6


【解决方案1】:

如果表格的单元格中没有对话行,或者代码针对不支持对角线的早期版本的 Word,则这些代码行是不必要的。如果此报告未被任何可能向表格单元格添加对角线的人编辑,则将这些行注释掉,并说明它们处于报告代码的不同“化身”中,但对于此代码的模板不是必需的工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-11-07
    • 1970-01-01
    • 2021-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多