Jump to content
Fórum Script Brasil
  • 0

Relatório No Word


Guest --Rafael --
 Share

Question

Guest --Rafael --

Será que podem me ajudar?

Tenho um relatório feito no Visio que após executar a macro ele gera um doc.

Ele gera o relatório com informações tudo certo, porém as cores do preenchimento da borda da tabela não consigo alterar.

Funcionava normalmente com o Office 2000, após alterar para 2003 ocorre este problema.

Segue uma parte do Código:

=================================================================================================

intRngStart = wrdRange.Start 'Armazena o ponto inicial para depois ser usado na conversão para tabela

With wrdRange

InsertFormatedText wrdRange, rsAreas("str_label") & vbTab & rsAreas("str_code") & vbCrLf, wdColorWhite, 11, True, wdAlignParagraphCenter, wdColorBlack

intRows = 1

strAreaCode = rsAreas("str_code")

'Escreve a descrição e funcionalidades

If rsAreas("str_areadescription") <> "" Then

InsertFormatedText wrdRange, astrText(1) & vbTab, wdColorBlack, 10, True

InsertFormatedText wrdRange, rsAreas("str_areadescription") & vbCrLf, wdColorBlack, 10, False

intRows = intRows + 1

End If

If rsAreas("str_areafunction") <> "" Then

InsertFormatedText wrdRange, astrText(2) & vbTab, wdColorBlack, 10, True

InsertFormatedText wrdRange, rsAreas("str_areafunction") & vbCrLf, wdColorBlack, 10, False

intRows = intRows + 1

End If

.InsertAfter (vbCrLf)

.Font.Size = 4

.ParagraphFormat.KeepWithNext = True

.Shading.BackgroundPatternColor = wdColorWhite

.Collapse (wdCollapseEnd)

End With

'Converte para tabela

Set wrdTableRange = gwrdDoc.Range(intRngStart, wrdRange.End - 1)

Set wrdTable = wrdTableRange.ConvertToTable(Separator:=Chr(9), NumRows:=intRows, NumColumns:=2)

'Seta as propriedades da tabela

With wrdTable

.TopPadding = PixelsToPoints(8)

.BottomPadding = PixelsToPoints(8)

.Borders.OutsideColor = wdColorGray25

.Borders.InsideColor = wdColorGray25

.Columns.Item(1).Width = InchesToPoints(2)

.Columns.Item(2).Width = InchesToPoints(5.5)

.Cell(1, 1).Width = InchesToPoints( 6.75)

.Cell(1, 2).Width = InchesToPoints(0.75)

.Cell(1, 1).Range.ParagraphFormat.Alignment = wdAlignParagraphLeft

End With

Set wrdTable = Nothing

Set wrdTableRange = Nothing

With wrdRange

.Delete wdCharacter, 1

.InsertAfter vbCrLf

.Font.Size = 4

.ParagraphFormat.KeepWithNext = True

.Collapse (wdCollapseEnd)

End With

==========================================================================================

Se puderem me ajudar agradeço.

Abraços.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
Guest --Rafael --

Estava Debugando e descobri que perde a formatação da tabela nas linhas abaixo, no momento em que converte pra tabela:

=================================================================================================

'Converte para tabela

Set wrdTableRange = gwrdDoc.Range(intRngStart, wrdRange.End - 1)

=> Set wrdTable = wrdTableRange.ConvertToTable(Separator:=Chr(9), NumRows:=intRows, NumColumns:=2)

'Seta as propriedades da tabela

With wrdTable

.TopPadding = PixelsToPoints(8)

.BottomPadding = PixelsToPoints(8)

.Borders.OutsideColor = wdColorGray25

.Borders.InsideColor = wdColorGray25

.Columns.Item(1).Width = InchesToPoints(2)

.Columns.Item(2).Width = InchesToPoints(5.5)

.Cell(1, 1).Width = InchesToPoints( 6.75)

.Cell(1, 2).Width = InchesToPoints(0.75)

.Cell(1, 1).Range.ParagraphFormat.Alignment = wdAlignParagraphLeft

End With

Set wrdTable = Nothing

Set wrdTableRange = Nothing

With wrdRange

.Delete wdCharacter, 1

.InsertAfter vbCrLf

.Font.Size = 4

.ParagraphFormat.KeepWithNext = True

.Collapse (wdCollapseEnd)

End With

==========================================================================================

Alguém me ajuda?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Forum Statistics

    • Total Topics
      149.8k
    • Total Posts
      646.6k
×
×
  • Create New...