You are on page 1of 40

Public Declare Function Extenso Lib "Extens32.

dll" _ Alias "extenso" (ByVal Valor As String, _ ByVal Retorno As String) As Integer Sub EscreveExtenso() On Error GoTo EscreveExtenso_Err Dim Dim Dim Dim strValor As String strRetorno As String strTmp As String x As Integer

If (Selection.Type = wdSelectionIP) And _ (Selection.Start = 0) Then Exit Sub Selection.MoveLeft Unit:=wdCharacter, Count:=1, _ Extend:=wdExtend While Selection.Text = " " If (Selection.Type = wdSelectionIP) And _ (Selection.Start = 0) Then Exit Sub Selection.ExtendMode = False Selection.MoveLeft Unit:=wdCharacter, Count:=1, _ Extend:=wdMove Wend Selection.MoveRight Unit:=wdCharacter, Count:=1, _ Extend:=wdMove Selection.ExtendMode = True With Selection.Find .Forward = False .Wrap = wdFindStop .Execute FindText:=" " End With 'Debug.Print Selection.Text strValor = Selection.Text Selection.ExtendMode = False Selection.MoveRight Unit:=wdCharacter, Count:=1, _ Extend:=wdMove strRetorno = String$(512, 32) '512 espaos x = Extenso(strValor, strRetorno) strTmp = " (" & Trim$(strRetorno) & "), " If x > 0 And strTmp <> " (real)" Then Selection.Font.Size = 9 Selection.Font.Bold = False Selection.TypeText Text:=strTmp End If EscreveExtenso_Fim: Exit Sub EscreveExtenso_Err: MsgBox Err.Description Resume EscreveExtenso_Fim End Sub

Sub insere() ' ' insere Macro ' Macro gravada 05/09/07 por SCA 'SERVE PRA FORMATAR A SITUAO CONTRATADA 'FORMATA TABELA Application.ScreenUpdating = False Selection.Font.Size = 6 Selection.Rows.HeightRule = wdRowHeightAuto Selection.Rows.Height = CentimetersToPoints(0) Selection.Columns.PreferredWidthType = wdPreferredWidthAuto Selection.Columns.PreferredWidth = 0 Selection.Cells.PreferredWidthType = wdPreferredWidthAuto Selection.Cells.PreferredWidth = 0 With Selection.Tables(1) With .Borders(wdBorderLeft) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .ColorIndex = wdAuto End With With .Borders(wdBorderRight) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .ColorIndex = wdAuto End With With .Borders(wdBorderTop) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .ColorIndex = wdAuto End With With .Borders(wdBorderBottom) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .ColorIndex = wdAuto End With With .Borders(wdBorderHorizontal) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth075pt .ColorIndex = wdAuto End With With .Borders(wdBorderVertical) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth075pt .ColorIndex = wdAuto End With .Borders.Shadow = False End With With Options .DefaultBorderLineStyle = wdLineStyleSingle .DefaultBorderLineWidth = wdLineWidth150pt .DefaultBorderColorIndex = wdAuto End With Selection.Cells.HeightRule = wdRowHeightAuto With Selection.Rows .Alignment = wdAlignRowCenter .AllowBreakAcrossPages = True .SetLeftIndent LeftIndent:=CentimetersToPoints(0), RulerStyle:= _ wdAdjustNone End With

Selection.Cells.AutoFit Selection.MoveLeft Application.ScreenUpdating = True 'ESCOLHE TABLE. tbl$ = Hex(InputBox$("SELECIONE A TABELA:" & Chr(13) & " 1 - SITUAO" & Chr(13) & " 2 - RECALCULO " & Chr(13) & " 3- ENCARGOS" & Chr(13) & " 0-SAIR) ")) Select Case tbl Case 1 INDICE = "INPC" 'FORMATA CABEALHO SC: Selection.InsertRowsAbove 1 Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.MoveUp Unit:=wdLine, Count:=1 XC = 0 Do XC = XC + 1 Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter GoSub fonte Selection.TypeText Text:=XC Selection.MoveRight Unit:=wdCell Loop Until XC > 15 Selection.MoveUp Unit:=wdLine, Count:=1 Selection.InsertRowsAbove 1 GoSub fonte Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.MoveUp Unit:=wdLine, Count:=1 'MONTA LINHA 1 Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop GoSub fonte Selection.TypeText Text:="Saldo" & Chr(11) & "Anterior" GoSub ftop GoSub fonte Selection.TypeText Text:="Data" & Chr(11) & "Vcto" GoSub ftop GoSub fonte Selection.TypeText Text:="Valor" GoSub ftop GoSub fonte Selection.TypeText Text:="Data" & Chr(11) & "Pagto" GoSub ftop GoSub fonte Selection.TypeText Text:="Compras" GoSub ftop GoSub fonte Selection.TypeText Text:="Comp." & Chr(11) & "Ext." 'RESUMI AQUI GoSub ftop GoSub fonte Selection.TypeText Text:="Data" & Chr(11) & "Saque" GoSub ftop GoSub fonte Selection.TypeText Text:="Saque" '& Chr(11) & "Dinheiro" CORTEI AQUI GoSub ftop GoSub fonte Selection.TypeText Text:="Saque" & Chr(11) & "Ext." 'RESUMI (& Chr(11) & "D inheiro") GoSub ftop GoSub fonte Selection.TypeText Text:="Soma" & Chr(11) & "Cons." & Chr(11) & "5+6+8+9" 'R ESUMI

GoSub ftop GoSub fonte Selection.TypeText GoSub ftop GoSub fonte Selection.TypeText GoSub ftop GoSub fonte Selection.TypeText GoSub ftop GoSub fonte Selection.TypeText GoSub ftop GoSub fonte Selection.TypeText RESUMI GoSub ftop GoSub fonte Selection.TypeText

Text:="Fatura" Text:="Saque" '& Chr(11) & "Dinheiro" RESUMI Text:="Multa" Text:="Juros" & Chr(11) & "Mora" Text:="Enc." & Chr(11) & "(11+12" & Chr(11) & "+13+14)" '

Text:="(1-3+" & Chr(11) & "10+15)"

'MONTA LINHA 2 Selection.MoveRight Unit:=wdCell Selection.MoveUp Unit:=wdLine, Count:=1 Selection.InsertRowsAbove 1 'FORMATA GoSub fonte Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.MoveUp Unit:=wdLine, Count:=1 Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop 'Mescla Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend Selection.Cells.Merge Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend Selection.Cells.Merge Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCharacter, Count:=6, Extend:=wdExtend Selection.Cells.Merge Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend Selection.Cells.Merge Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend Selection.Cells.Merge Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell 'acerta ponteiro Selection.MoveUp Selection.MoveLeft 'escreve Selection.MoveRight Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Fatura"

Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Pagamento" Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Consumo" Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Encargos" & Chr(11) & "Contratuais" Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Encargos" & Chr(11) & "Mora" Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Soma" Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Saldo" 'posiciona ponteiro Selection.InsertRowsAbove 1 Selection.Cells.Merge 'escreve Selection.MoveRight Unit:=wdCell Selection.MoveUp GoSub fcbec Selection.TypeText Text:="Situao Contratada" GoSub ajtbl2 'RECLCULO Case 2 '[QUADRO 2 RECLCULO] '[ ] Selection.InsertRowsAbove 1 Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.MoveUp Unit:=wdLine, Count:=1 XC = 16 Do XC = XC + 1 GoSub fonte If XC < 26 Then Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText Text:=XC Selection.MoveRight Unit:=wdCell End If If XC >= 26 Then Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText Text:=(XC - 1) Selection.MoveRight Unit:=wdCell End If Loop Until XC > 32 Selection.MoveUp Unit:=wdLine, Count:=1 Selection.InsertRowsAbove 1 GoSub fonte 'formato padro Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop GoSub fonte Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.MoveUp Unit:=wdLine, Count:=1 'MONTA LINHA 1 Selection.TypeText Text:="Saldo" & Chr(11) & "Anteior"

Selection.MoveRight Unit:=wdCell Selection.TypeText Text:="Data" & Chr(11) & "Vcto" Selection.MoveRight Unit:=wdCell Selection.TypeText Text:="Pagto" & Chr(11) & "Efetuado" Selection.MoveRight Unit:=wdCell Selection.TypeText Text:="Enc." & Chr(11) & "Financ." & Chr(11) & "Cash+Sd" Selection.MoveRight Unit:=wdCell 'Pega indice INDICE = InputBox$("QUAL O NDICE DE CORREO:" & Chr(13) & " 1 - INPC" & Chr(13) & " 2 - IGP-M " & Chr(13) & " 3- TR" & Chr(13) & " 0-S. CORR) ") If INDICE = 1 Then INDICE = "INPC" End If If INDICE = 2 Then INDICE = "IGP-M" End If If INDICE = 3 Then INDICE = "TR" End If If INDICE = 0 Then INDICE = "S.Cor." End If Selection.TypeText Text:="Corr." & Chr(11) & "Monet." & Chr(11) & INDICE Selection.MoveRight Unit:=wdCell Selection.TypeText Text:="Multa" Selection.MoveRight Unit:=wdCell Selection.TypeText Text:="Juros" & Chr(11) & "Mora" Selection.MoveRight Unit:=wdCell Selection.TypeText Text:="Soma" & Chr(11) & "Encargos" & Chr(11) & "(20+21+" & Chr(11) & "22+23)" Selection.MoveRight Unit:=wdCell Selection.TypeText Text:="Saldo" & Chr(11) & "Pagto" Selection.MoveRight Unit:=wdCell Selection.TypeText Text:="Soma" & Chr(11) & "Garantia" & Chr(11) & "Administ rao" With Application.Assistant Select Case _ .DoAlert( _ "DELETAR", _ "GARANTIA E ADMINISTRAO" & Chr(13) & "(COL. 26)" & Chr(13) & "SIM PARA DELETAR", _ msoAlertButtonYesNo, _ msoAlertIconCritical, _ msoAlertDefaultSecond, _ msoAlertCancelFirst, _ False) Case vbYes: GoTo deletga Case vbNo: GoTo nodel End Select End With deletga: Selection.Columns.Delete Selection.MoveLeft Unit:=wdCell nodel: Selection.MoveRight Unit:=wdCell Selection.TypeText Text:="Compras" Selection.MoveRight Unit:=wdCell

Selection.TypeText Text:="Compras" & Chr(11) & "Ext." Selection.MoveRight Unit:=wdCell Selection.TypeText Text:="Data" & Chr(11) & "Saque" Selection.MoveRight Unit:=wdCell Selection.TypeText Text:="Saque" '& Chr(11) & "Dinheiro" Selection.MoveRight Unit:=wdCell Selection.TypeText Text:="Saque" & Chr(11) & "Din." & Chr(11) & "Ext." Selection.MoveRight Unit:=wdCell Selection.TypeText Text:="Saldo" & Chr(11) & "Devedor" 'posiciona ponteiro Selection.InsertRowsAbove 1 Selection.Cells.Merge 'escreve Selection.MoveRight Unit:=wdCell Selection.MoveUp GoSub fcbec Selection.TypeText Text:="Situao Conforme Decises" & COMPRAST Case 3 'ENCARGOS Selection.InsertRowsAbove 1 Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.MoveUp Unit:=wdLine, Count:=1 XC = 31 'coluna inicial Do XC = XC + 1 'incrementa GoSub fonte Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter 'alinhamento do s n. Selection.TypeText Text:=XC 'digita n Selection.MoveRight Unit:=wdCell 'muda de cel Loop Until XC > 43 'incrementa Selection.MoveUp Unit:=wdLine, Count:=1 Selection.InsertRowsAbove 1 GoSub fonte Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.MoveUp Unit:=wdLine, Count:=1 Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Data" & Chr(11) & "Vcto" Selection.MoveRight Unit:=wdCell INDICE = InputBox$("QUAL O NDICE DE CORREO:" & Chr(13) & " 1 - INPC" & Chr(13) & " 2 - IGP-M " & Chr(13) & " 3- TR" & Chr(13) & " 0-S. CORR) ") If INDICE = 1 Then INDICE = "INPC" End If If INDICE = 2 Then INDICE = "IGP-M" End If If INDICE = 3 Then INDICE = "TR" End If If INDICE = 0 Then INDICE = "S.Cor." End If Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Corr." & Chr(11) & "Monet." & Chr(11) & INDICE Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Corr." & Chr(11) & "Mon" & Chr(11) & "Fatura"

Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Corr." & Chr(11) & "Mon" & Chr(11) & "Cash" Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Soma" & Chr(11) & "Corr." & Chr(11) & "Monet." Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Multa" & Chr(11) & "%" Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText "Multa" Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText "Mora" Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Juros" & Chr(11) & "Cash" Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Tx. Juros" & Chr(11) & "Sdo Dev" Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Juros" & Chr(11) & "Sdo Dev" Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Soma" & Chr(11) & "Juros" & Chr(11) & "40+42" Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Selection.TypeText Text:="Juros" & Chr(11) & "Acumulados" 'posiciona ponteiro Selection.InsertRowsAbove 1 Selection.Cells.Merge 'escreve Selection.MoveRight Unit:=wdCell Selection.MoveUp GoSub fcbec Selection.TypeText Text:="Encargos Conforme Decises" Case 0 End Select Exit Sub fonte: With Selection.Font .Name = "Arial" .Size = 6 .Bold = True End With Return Exit Sub ftop: Selection.MoveRight Unit:=wdCell Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Return Exit Sub fcbec: With Selection.Font .Name = "Arial" .Size = 10 .Bold = True

.Italic = False .Underline = wdUnderlineNone .UnderlineColor = wdColorAutomatic .StrikeThrough = False .DoubleStrikeThrough = False .Outline = False .Emboss = False .Shadow = False .Hidden = False .SmallCaps = False .AllCaps = False .Color = wdColorAutomatic .Engrave = False .Superscript = False .Subscript = False .Spacing = 0 .Scaling = 100 .Position = 0 .Kerning = 0 .Animation = wdAnimationNone End With Return Exit Sub ajtbl2: Selection.Tables(1).Select With Selection.Cells(1) .TopPadding = CentimetersToPoints(0) .BottomPadding = CentimetersToPoints(0) .LeftPadding = CentimetersToPoints(0.05) .RightPadding = CentimetersToPoints(0.05) .WordWrap = False .FitText = False End With Return 'INSERE TERMINA AQUI End Sub

Sub TextStreamTest() Const ForReading = 1, ForWriting = 2, ForAppending = 3 Dim fs, f Dim linhas(20) As String Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.OpenTextFile("c:\arqteste.txt") estado$ = InputBox$("ESTADO E PARTE:") Do While f.AtEndOfStream <> True s5 = s4 s4 = s3 s3 = s2 s2 = s1 s1 = s s = f.ReadLine If s5 = estado Then If linhas(4) = "" Then 'case 1 linhas(0) = s4 'ajusta o texto na fila 1 de seleo linhas(1) = s3

linhas(2) = s2 linhas(3) = s1 linhas(4) = s s4 = "" 'limpa memoria s3 = "" s2 = "" s1 = "" s = "" ElseIf linhas(9) = "" Then 'case 2 linhas(5) = s4 'ajusta o texto na fila 2 de seleo linhas(6) = s3 linhas(7) = s2 linhas(8) = s1 linhas(9) = s s4 = "" 'limpa memoria s3 = "" s2 = "" s1 = "" s = "" Else linhas(10) = s4 'ajusta o texto na fila 3 de seleo linhas(11) = s3 linhas(12) = s2 linhas(13) = s1 linhas(14) = s s4 = "" 'limpa memoria s3 = "" s2 = "" s1 = "" s = "" End If End If Loop 'ESCOLHE ESTADO. cp = linhas(0) + linhas(1) + linhas(2) + linhas(3) + linhas(4) cp1 = linhas(5) + linhas(6) + linhas(7) + linhas(8) + linhas(9) cp2 = linhas(10) + linhas(11) + linhas(12) + linhas(13) + linhas(14) 'cp3 = If cp = "" Then 'sem dados ESTSEL$ = InputBox$("NO ENCONTRADO") 'ElseIf cp3 <> "" Then ElseIf cp2 <> "" Then '3 ocorrencias ESTSEL$ = InputBox$("SELECIONE ESCRITORIO:" & Chr(13) & _ " 1- " & linhas(0) & Chr(13) & " " & linhas(1) & Chr(13) & " " & lin has(2) & Chr(13) & " " & linhas(3) & " " & linhas(4) & Chr(13) & Chr(13) & _ " 2- " & linhas(5) & Chr(13) & " " & linhas(6) & Chr(13) & " " & lin has(7) & Chr(13) & " " & linhas(8) & " " & linhas(9) & Chr(13) & Chr(13) & _ " 3- " & linhas(10) & Chr(13) & " " & linhas(11) & Chr(13) & " " & l inhas(12) & Chr(13) & " " & linhas(13) & " " & linhas(14) & Chr(13) & Ch r(13) & _ " 0- SAIR") ElseIf cp1 <> "" Then '2 ocorrencias

ESTSEL$ = InputBox$("SELECIONE ESCRITORIO:" & Chr(13) & _ " 1- " & linhas(0) & Chr(13) & " " & linhas(1) & Chr(13) & " " & lin has(2) & Chr(13) & " " & linhas(3) & " " & linhas(4) & Chr(13) & Chr(13) & _ " 2- " & linhas(5) & Chr(13) & " " & linhas(6) & Chr(13) & " " & lin has(7) & Chr(13) & " " & linhas(8) & " " & linhas(9) & Chr(13) & Chr(13) & _ " 0- SAIR") Else 'uma ocorrencia ESTSEL$ = InputBox$("SELECIONE ESCRITORIO:" & Chr(13) & " 1- " & linhas(0) & Chr(13) & " " & linhas(1) & Chr(13) & " " & linhas(3) & Chr(13) & Chr(1 3) & " 0- SAIR") End If Select Case ESTSEL Case 0 f.Close Case 1 Selection.TypeText Text:=linhas(0) Selection.TypeParagraph Selection.TypeText Text:=linhas(1) Selection.TypeParagraph Selection.TypeText Text:=linhas(2) Selection.TypeParagraph Selection.TypeText Text:=linhas(3) Selection.TypeParagraph Selection.TypeText Text:=linhas(4) f.Close Case 2 Selection.TypeText Text:=linhas(5) Selection.TypeParagraph Selection.TypeText Text:=linhas(6) Selection.TypeParagraph Selection.TypeText Text:=linhas(7) Selection.TypeParagraph Selection.TypeText Text:=linhas(8) Selection.TypeParagraph Selection.TypeText Text:=linhas(9) f.Close End Select End Sub Sub Lememo() ' ' Lememo Macro ' Macro gravada 29/01/08 por SCA ' With Selection.ParagraphFormat .LeftIndent = CentimetersToPoints(1) .RightIndent = CentimetersToPoints(0) .SpaceBefore = 0 .SpaceBeforeAuto = False 'cliente' 'Escrit.' 'end1 'end2 'end3 'cliente' 'Escrit.' 'end1 'end2 'end3

.SpaceAfter = 0 .SpaceAfterAuto = False .LineSpacingRule = wdLineSpaceSingle .Alignment = wdAlignParagraphJustify .WidowControl = True .KeepWithNext = False .KeepTogether = False .PageBreakBefore = False .NoLineNumber = False .Hyphenation = True .FirstLineIndent = CentimetersToPoints(2) .OutlineLevel = wdOutlineLevelBodyText .CharacterUnitLeftIndent = 0 .CharacterUnitRightIndent = 0 .CharacterUnitFirstLineIndent = 0 .LineUnitBefore = 0 .LineUnitAfter = 0 End With Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = vbTab .Replacement.Text = "#" .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Selection.MoveRight Unit:=wdCharacter 'VARIVEIS LIDAS desde = "" Unid = "" Voriginal = "" Descr = "" ate = "" Corrigido = "" juros1 = "" juros2 = "" Juros3 = "" MultaP = "" Tjuros = "" Atualizado = "" 'VARIAVEIS DE CALCULO Vcorr = 0 ' VALOR CORRIGIDO - ORIGINAL. VC% = 0 'PERCENTUAL DE CORREO '1 valor lc = "" 'limpa leiruta de caractere' lcs = 0 'limpa tamnaho do texto' Do Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend lc = Selection.Text

Selection.MoveLeft Unit:=wdCharacter lcs = lcs + 1 'contagem da seleo Loop Until lc = "#" lcs = lcs - 1 Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveRight Unit:=wdCharacter, Count:=lcs, Extend:=wdExtend Atualizado = Selection.Text Selection.Delete '2 valor lc = "" 'limpa leiruta de caractere' lcs = 0 'limpa tamnaho do texto' Do Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend lc = Selection.Text Selection.MoveLeft Unit:=wdCharacter lcs = lcs + 1 'contagem da seleo Loop Until lc = "#" lcs = lcs - 1 Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveRight Unit:=wdCharacter, Count:=lcs, Extend:=wdExtend Tjuros = Selection.Text Selection.Delete '3 valor lc = "" 'limpa leiruta de caractere' lcs = 0 'limpa tamnaho do texto' Do Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend lc = Selection.Text Selection.MoveLeft Unit:=wdCharacter lcs = lcs + 1 'contagem da seleo Loop Until lc = "#" lcs = lcs - 1 Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveRight Unit:=wdCharacter, Count:=lcs, Extend:=wdExtend MultaP = Selection.Text Selection.Delete '4 valor lc = "" 'limpa leiruta de caractere' lcs = 0 'limpa tamnaho do texto' Do Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend lc = Selection.Text Selection.MoveLeft Unit:=wdCharacter lcs = lcs + 1 'contagem da seleo Loop Until lc = "#" lcs = lcs - 1 Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveRight Unit:=wdCharacter, Count:=lcs, Extend:=wdExtend Juros3 = Selection.Text Selection.Delete '5 valor lc = "" 'limpa leiruta de caractere' lcs = 0 'limpa tamnaho do texto' Do Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend lc = Selection.Text

Selection.MoveLeft Unit:=wdCharacter lcs = lcs + 1 'contagem da seleo Loop Until lc = "#" lcs = lcs - 1 Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveRight Unit:=wdCharacter, Count:=lcs, Extend:=wdExtend juros2 = Selection.Text Selection.Delete '6 valor lc = "" 'limpa leiruta de caractere' lcs = 0 'limpa tamnaho do texto' Do Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend lc = Selection.Text Selection.MoveLeft Unit:=wdCharacter lcs = lcs + 1 'contagem da seleo Loop Until lc = "#" lcs = lcs - 1 Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveRight Unit:=wdCharacter, Count:=lcs, Extend:=wdExtend juros1 = Selection.Text Selection.Delete '7 valor lc = "" 'limpa leiruta de caractere' lcs = 0 'limpa tamnaho do texto' Do Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend lc = Selection.Text Selection.MoveLeft Unit:=wdCharacter lcs = lcs + 1 'contagem da seleo Loop Until lc = "#" lcs = lcs - 1 Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveRight Unit:=wdCharacter, Count:=lcs, Extend:=wdExtend Corrigido = Selection.Text Selection.Delete '8 valor lc = "" 'limpa leiruta de caractere' lcs = 0 'limpa tamnaho do texto' Do Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend lc = Selection.Text Selection.MoveLeft Unit:=wdCharacter lcs = lcs + 1 'contagem da seleo Loop Until lc = "#" lcs = lcs - 1 Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveRight Unit:=wdCharacter, Count:=lcs, Extend:=wdExtend ate = Selection.Text Selection.Delete '9 valor lc = "" 'limpa leiruta de caractere' lcs = 0 'limpa tamnaho do texto' Do Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend lc = Selection.Text Selection.MoveLeft Unit:=wdCharacter lcs = lcs + 1 'contagem da seleo

Loop Until lc = "#" lcs = lcs - 1 Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveRight Unit:=wdCharacter, Count:=lcs, Extend:=wdExtend Descr = Selection.Text Selection.Delete '10 valor lc = "" 'limpa leiruta de caractere' lcs = 0 'limpa tamnaho do texto' Do Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend lc = Selection.Text Selection.MoveLeft Unit:=wdCharacter lcs = lcs + 1 'contagem da seleo Loop Until lc = "#" lcs = lcs - 1 Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveRight Unit:=wdCharacter, Count:=lcs, Extend:=wdExtend Voriginal = Selection.Text Selection.Delete '11 valor lc = "" 'limpa leiruta de caractere' lcs = 0 'limpa tamnaho do texto' Do Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend lc = Selection.Text Selection.MoveLeft Unit:=wdCharacter lcs = lcs + 1 'contagem da seleo Loop Until lc = "#" lcs = lcs - 1 Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveRight Unit:=wdCharacter, Count:=lcs, Extend:=wdExtend Unid = Selection.Text Selection.Delete '12 valor lc = "" 'limpa leitura de caractere' lcs = 0 'limpa tamnaho do texto' Selection.MoveLeft Unit:=wdCharacter, Count:=8, Extend:=wdExtend desde = Selection.Text Selection.Delete Selection.MoveUp Unit:=wdLine, Count:=2, Extend:=wdExtend Selection.Delete Unit:=wdCharacter, Count:=1 Selection.Delete Unit:=wdCharacter, Count:=1 'Clculos Vcorr = CCur(Corrigido) - CCur(Voriginal) VCP = CDec((Vcorr / CCur(Voriginal)) * 100) VCPA = Round(VCP, 2) 'Sada tabela If juros2 = "0,00" Then 'define n. linhas XC = 6 Else XC = 7 End If Selection.TypeParagraph ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=XC, NumColumns: = _ 3, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _

wdAutoFitContent With Selection.Tables(1) If .Style <> "Table Grid" Then .Style = "Table Grid" End If .ApplyStyleHeadingRows = True .ApplyStyleLastRow = True .ApplyStyleFirstColumn = True .ApplyStyleLastColumn = True End With Selection.MoveDown Unit:=wdLine, Count:=4, Extend:=wdExtend Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend With Selection.Tables(1) With .Borders(wdBorderLeft) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderRight) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderTop) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderBottom) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderHorizontal) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth075pt .Color = wdColorAutomatic End With With .Borders(wdBorderVertical) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth075pt .Color = wdColorAutomatic End With .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone .Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone .Borders.Shadow = False End With With Options .DefaultBorderLineStyle = wdLineStyleSingle .DefaultBorderLineWidth = wdLineWidth150pt .DefaultBorderColor = wdColorAutomatic End With Selection.Tables(1).Rows.Alignment = wdAlignRowCenter Selection.MoveDown Unit:=wdLine, Count:=1 Selection.MoveUp Unit:=wdLine, Count:=5 'posiciona na primeira clila da linha 1 'DESCRIO Selection.MoveRight Unit:=wdCharacter, Count:=3, Extend:=wdExtend Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.Cells.Merge

With Selection.Font .Name = "Arial" .Size = 10 .Bold = True .Italic = False .Underline = wdUnderlineNone .UnderlineColor = wdColorAutomatic .StrikeThrough = False .DoubleStrikeThrough = False .Outline = False .Emboss = False .Shadow = False .Hidden = False .SmallCaps = False .AllCaps = False .Color = wdColorAutomatic .Engrave = False .Superscript = False .Subscript = False .Spacing = 0 .Scaling = 100 .Position = 0 .Kerning = 0 .Animation = wdAnimationNone End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("Valor Atualizado - " & Descr) 'DESCRIO 2 Selection.MoveDown Unit:=wdLine, Count:=1 Selection.MoveLeft Unit:=wdCell, Count:=2 With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("Item") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("Descrio") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText (" Valor") 'VALOR PRINCIPAL Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With

Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("1") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText ("Saldo em " & desde) Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText (Unid & " " & Voriginal) 'CORREO Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("2") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText ("Correo Monetria (" & VCPA & "%) desde " & desde & " at " & ate) Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText FormatCurrency(Vcorr) 'JUROS 0,5% If juros2 <> "0,00" Then Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("3") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText ("Juros de 0,5% a. m. - de " & desde & " at 10/01/03") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial"

.Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText FormatCurrency(juros1) 'JUROS 1,0% Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("4") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText ("Juros de 1% a. m. - de 10/01/03 at " & ate) Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText FormatCurrency(juros2) 'ATUALIZADO Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("5") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText ("Valor Atualizado (1+2+3+4) em " & ate) Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText FormatCurrency(CCur(Atualizado)) End If If juros2 = "0,00" Then 'JUROS 1% Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With

Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("3") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText ("Juros de 1% a. m. - de " & desde & " at " & ate) Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText FormatCurrency(juros1) 'ATUALIZADO Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("4") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText ("Valor Atualizado (1+2+3) em " & ate) Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText FormatCurrency(CCur(Atualizado)) End If End Sub Sub leitura() ' ' leitura Macro ' Macro gravada 18/09/07 por SCA ' Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell pagto = Selection.Text Selection.MoveLeft Unit:=wdCell Selection.Delete Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell compras = Selection.Text

Selection.MoveRight Unit:=wdCell comprasx = Selection.Text Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell saque = Selection.Text Selection.MoveRight Unit:=wdCell saquex = Selection.Text Selection.MoveRight Unit:=wdCell 'consumo somac = Selection.Text 'Encargos Selection.MoveRight Unit:=wdCell EncargosF = Selection.Text Selection.MoveRight Unit:=wdCell encargoscash = Selection.Text Selection.MoveRight Unit:=wdCell Multa = Selection.Text Selection.MoveRight Unit:=wdCell mora = Selection.Text Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell Selection.MoveUp Selection.MoveLeft Unit:=wdCell Selection.MoveRight Unit:=wdCell saldo = Selection.Text 'DATA E SAIDA Selection.MoveLeft Unit:=wdCell, Count:=14 '0-ano Selection.MoveRight Unit:=wdCharacter Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend ano = Selection.Text '1-mes Selection.MoveLeft Unit:=wdCharacter, Count:=2 Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend mes = Selection.Text '2-dia Selection.MoveLeft Unit:=wdCharacter, Count:=2 Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend dia = Selection.Text

'Saida Selection.MoveDown Selection.MoveDown 'COMPRAS Selection.Font.Bold = False Selection.TypeText Text:="Durante o perodo, o Autor consumiu em compras " 'com compras no exterior vcx = Val(comprasx) If vcx = 0 Then Selection.Font.Bold = True Selection.TypeText Text:="R$" & compras Selection.Font.Bold = False Selection.Font.Size = 9 Selection.TypeText Text:=" (Coluna 5)" Else somacompra = CCur(compras) + CCur(comprasx)

Selection.Font.Bold = True Selection.TypeText Text:=FormatCurrency(somacompra) & " " Selection.Font.Bold = True Selection.Font.Bold = False Selection.Font.Size = 9 Selection.TypeText Text:=" (Colunas 5 e 6)" End If 'SAQUES 'com saque no exterior vsx = Val(saquex) 'verifica se houve saque no exterior vs = Val(saque) 'verifica se houve saque If vsx > 0 Then Selection.Font.Size = 12 Selection.TypeText Text:=". Sacou em dinheiro " Selection.Font.Bold = True somasaque@ = (CCur(saque) + CCur(saquex)) Selection.TypeText Text:=FormatCurrency(somasaque) Selection.Font.Bold = False Selection.Font.Size = 9 Selection.TypeText Text:=" (Colunas 8 e 9)" Selection.Font.Size = 12 Selection.TypeText Text:=". " ElseIf vs > 0 Then Selection.Font.Size = 12 Selection.TypeText Text:=". Sacou em dinheiro " Selection.Font.Bold = True Selection.TypeText Text:="R$" & saque Selection.Font.Bold = False Selection.Font.Size = 9 Selection.TypeText Text:=" (Coluna 8)" End If 'PAGAMENTOS vpg = Val(pagto) If vpg > 0 Then Selection.Font.Size = 12 Selection.TypeText Text:=". Pagou " Selection.Font.Bold = True Selection.TypeText Text:="R$" & pagto Selection.Font.Bold = False Selection.Font.Size = 9 Selection.TypeText Text:=" (Coluna 3)" Selection.Font.Size = 12 Selection.TypeText Text:=". " Else Selection.TypeText Text:=". No efetuou pagamentos" End If vsi = Val(somac) If vsi > vpg Then Selection.Font.Size = 12 Selection.TypeText Text:="A soma do consumo totalizou " Selection.Font.Bold = True Selection.TypeText Text:="R$" & somac Selection.Font.Bold = False Selection.TypeText Text:=". " Selection.Font.Bold = True Selection.TypeText Text:=" Nota-se que os pagamentos efetuados no bastaram pa

ra suprir o consumo" Selection.Font.Bold = False Selection.TypeText Text:=". " End If Selection.TypeText Text:="Foi cobrado de encargos contratuais sobre o saldo devedor, quando a fatura mensal no foi paga integralmente, " Selection.Font.Bold = True 'ENCARGOS Selection.TypeText Text:="R$" & EncargosF Selection.Font.Bold = False Selection.Font.Bold = False Selection.Font.Size = 9 Selection.TypeText Text:=" (Coluna 11)" Selection.Font.Size = 12 Selection.TypeText Text:="." vec = Val(encargoscash) If vec > 0 Then Selection.Font.Size = 12 Selection.TypeText Text:=" Foi cobrado de encargos credicash, sobre os saque s em moeda corrente, " Selection.Font.Bold = True Selection.TypeText Text:="R$" & encargoscash Selection.Font.Bold = False Selection.Font.Size = 9 Selection.TypeText Text:=" (Coluna 12)" Selection.Font.Size = 12 Selection.TypeText Text:="." End If vmu = Val(Multa) If vmu > 0 Then Selection.Font.Size = 12 Selection.TypeText Text:=" Foi cobrado " Selection.Font.Bold = True Selection.TypeText Text:="R$" & Multa Selection.Font.Bold = False Selection.TypeText Text:=" relativo a multa" Selection.Font.Size = 9 Selection.TypeText Text:=" (Coluna 13)" Selection.Font.Size = 12 Selection.TypeText Text:=" e " Selection.Font.Bold = True Selection.TypeText Text:="R$" & mora Selection.Font.Bold = False Selection.TypeText Text:=" relativos a mora " Selection.Font.Size = 9 Selection.TypeText Text:="(Coluna 14)" Selection.Font.Size = 12 Selection.TypeText Text:=" pelo atraso de pagamento." End If Selection.Font.Size = 12 Selection.TypeText Text:=" Segundo condies pactuadas, apresentou o saldo deved or de " Selection.Font.Bold = True 'SALDO Selection.TypeText Text:="R$" & saldo Selection.Font.Bold = False Selection.Font.Size = 9 Selection.TypeText Text:=" (Coluna 16)" Selection.Font.Size = 12 Selection.TypeText Text:=" em "

'Data FINAL 'arranjo dos meses Dim meses(1 To 12) As String meses(1) = "janeiro" meses(2) = "fevereiro" meses(3) = "maro" meses(4) = "abril" meses(5) = "maio" meses(6) = "junho" meses(7) = "julho" meses(8) = "agosto" meses(9) = "setembro" meses(10) = "outubro" meses(11) = "novembro" meses(12) = "dezembro" 'arranjo dos anos Dim anos4(1 To 2) As String anos4(1) = "19" anos4(2) = "20" If mes = "01" Then mes = meses(1) If mes = "02" Then mes = meses(2) If mes = "03" Then mes = meses(3) If mes = "04" Then mes = meses(4) If mes = "05" Then mes = meses(5) If mes = "06" Then mes = meses(6) If mes = "07" Then mes = meses(7) If mes = "08" Then mes = meses(8) If mes = "09" Then mes = meses(9) If mes = "10" Then mes = meses(10) If mes = "11" Then mes = meses(11) If mes = "12" Then mes = meses(12)

'ajusta texto do ano If ano = "00" Then ano = anos4(2) & ano If ano = "01" Then ano = anos4(2) & ano If ano = "02" Then ano = anos4(2) & ano If ano = "03" Then ano = anos4(2) & ano If ano = "04" Then ano = anos4(2) & ano If ano = "05" Then ano = anos4(2) & ano If ano = "06" Then ano = anos4(2) & ano If ano = "07" Then ano = anos4(2) & ano If ano = "08" Then ano = anos4(2) & ano If ano = "09" Then ano = anos4(2) & ano If ano = "10" Then ano = anos4(2) & ano If ano = "99" Then ano = anos4(1) & ano If ano = "98" Then ano = anos4(1) & ano If ano = "97" Then ano = anos4(1) & ano If ano = "96" Then ano = anos4(1) & ano If ano = "95" Then ano = anos4(1) & ano If ano = "94" Then ano = anos4(1) & ano 'IMPRIME Selection.TypeText Text:=dia & " de " & mes & " de " & ano & "." End Sub

Sub Macro1() ' ' Macro1 Macro ' Macro gravada 13/02/08 por SCA ' Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.Font.Bold = wdToggle Selection.TypeText Text:="Marcello Sinigaglia" Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeParagraph Selection.TypeText Text:="CRC/PR RS 0000" Selection.HomeKey Unit:=wdLine End Sub Sub tirap() ' ' tirap Macro ' Macro gravada 25/02/08 por SCA ' With Selection.ParagraphFormat .LeftIndent = CentimetersToPoints(1) .RightIndent = CentimetersToPoints(0) .SpaceBefore = 0 .SpaceBeforeAuto = False .SpaceAfter = 0 .SpaceAfterAuto = False .LineSpacingRule = wdLineSpaceSingle .Alignment = wdAlignParagraphJustify .WidowControl = True .KeepWithNext = False .KeepTogether = False .PageBreakBefore = False .NoLineNumber = False .Hyphenation = True .FirstLineIndent = CentimetersToPoints(2) .OutlineLevel = wdOutlineLevelBodyText .CharacterUnitLeftIndent = 0 .CharacterUnitRightIndent = 0 .CharacterUnitFirstLineIndent = 0 .LineUnitBefore = 0 .LineUnitAfter = 0 End With End Sub Sub BCBFIAT() ' ' BCBFIAT Macro ' Macro gravada 26/02/08 por SCA ' Const ForReading = 1, ForWriting = 2, ForAppending = 3 Dim fs, f Dim linhas(100) As String Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.OpenTextFile("c:\bcb.txt")

'Entrada de dados mes_ini$ = InputBox$("Ms Inicial(jun-00):") mes_fin$ = InputBox$("Ms Final(jun-00):") T_Ct$ = InputBox$("Taxa M. Cont.(2,59217%):") 'variveis M_menor = 0 'mes da menor taxa T_menor = 0 'menor taxa M_maior = 0 'mes da maior taxa T_maior = 0 'menor taxa Do While f.AtEndOfStream <> True s = f.ReadLine s1 = s x = x + 1 linhas(1) = s Selection.TypeText (linhas()) Loop End Sub Sub nmemo() Dim RetVal RetVal = Shell("C:\Memo5\Memo5.exe", 1)

' Execute Calculadora.

End Sub Sub Abrepasta() ' ' Abrepasta Macro ' Macro gravada 03/12/08 por SCAED ' retorna: psp$ = "0" psp$ = InputBox$("DIGITE O N DA OS:") Set PSTso = CreateObject("Scripting.FileSystemObject") Dim RetVal If psp = "0" Then GoTo saida If psp = 1 Then GoTo temp If psp = 3 Then GoTo OLD If psp <= 3999 Then GoTo descontinuada If psp >= 20001 Then GoTo p20000210001 If psp >= 19001 Then GoTo p19000200001 If psp >= 18001 Then GoTo p18000190001 If psp >= 17001 Then GoTo p17000180001 If psp >= 16001 Then GoTo p16000170001 If psp >= 15001 Then GoTo p15000160001 If psp >= 14001 Then GoTo p14000150001 If psp >= 13001 Then GoTo p13000140001 If psp >= 12001 Then GoTo p12000130001 If psp >= 11001 Then GoTo p11000120001 If psp >= 10001 Then GoTo p10000110001 If psp >= 9001 Then GoTo p09000100000 If psp >= 8001 Then GoTo p08000090000 If psp >= 7001 Then GoTo p07000080000 If psp >= 6001 Then GoTo p06000070000 If psp >= 5001 Then GoTo p05000060000 If psp >= 4001 Then GoTo p04000050000 'DIRETRIO NORMAL p20000210001: RetVal = Shell("explorer.exe P:\Arq Trabalho\20001 - 21000\" & psp, 1)

GoTo saida p19000200001: RetVal = Shell("explorer.exe P:\Arq Trabalho\19001 - 20000\" & psp, 1) GoTo saida p18000190001: RetVal = Shell("explorer.exe P:\Arq Trabalho\18001 - 19000\" & psp, 1) GoTo saida p17000180001: RetVal = Shell("explorer.exe P:\Arq Trabalho\17001 - 18000\" & psp, 1) GoTo saida p16000170001: RetVal = Shell("explorer.exe P:\Arq Trabalho\16001 - 17000\" & psp, 1) GoTo saida p15000160001: RetVal = Shell("explorer.exe P:\Arq Trabalho\15001 - 16000\" & psp, 1) GoTo saida p14000150001: RetVal = Shell("explorer.exe P:\Arq Trabalho\14001 - 15000\" & psp, 1) GoTo saida p13000140001: RetVal = Shell("explorer.exe P:\Arq Trabalho\13001 - 14000\" & psp, 1) GoTo saida p12000130001: RetVal = Shell("explorer.exe P:\Arq Trabalho\12001 - 13000\" & psp, 1) GoTo saida p11000120001: RetVal = Shell("explorer.exe P:\Arq Trabalho\11001 - 12000\" & psp, 1) GoTo saida p10000110001: RetVal = Shell("explorer.exe P:\Arq Trabalho\10001 - 11000\" & psp, 1) GoTo saida p09000100000: psp = "0" & psp RetVal = Shell("explorer.exe P:\Arq Trabalho\09001 - 10000\" & psp, 1) GoTo saida p08000090000: psp = "0" & psp RetVal = Shell("explorer.exe P:\Arq Trabalho\08001 - 09000\" & psp, 1) GoTo saida p07000080000: psp = "0" & psp RetVal = Shell("explorer.exe P:\Arq Trabalho\07001 - 08000\" & psp, 1) GoTo saida p06000070000: psp = "0" & psp RetVal = Shell("explorer.exe P:\Arq Trabalho\06001 - 07000\" & psp, 1) GoTo saida p05000060000: psp = "0" & psp RetVal = Shell("explorer.exe P:\Arq Trabalho\05001 - 06000\" & psp, 1) GoTo saida p04000050000: psp = "0" & psp RetVal = Shell("explorer.exe P:\Arq Trabalho\04000 - 05000\" & psp, 1) GoTo saida temp: RetVal = Shell("explorer.exe t:", 1) OLD: RetVal = Shell("explorer.exe \\Srvdata\arq_trabalho", 1) GoTo saida

descontinuada: With Application.Assistant Select Case _ .DoAlert( _ "AVISO DE PASTAS ANTIGAS", _ "ESTA PASTA ANTIGA E FOI ARQUIVADA." & Chr(13) & "FALE COM O ADMINIS TRADOR." & Chr(13) & "DESEJA ABRIR OUTRA PASTA", _ msoAlertButtonYesNo, _ msoAlertIconCritical, _ msoAlertDefaultSecond, _ msoAlertCancelFirst, _ False) Case vbYes: GoTo retorna Case vbNo: GoTo saida End Select End With GoTo saida saida: End Sub Sub CRC() contador$ = Hex(InputBox$("SELECIONE O 3) & " 2 - EHS " & Chr(13) & Chr(13) & Select Case contador Case 0 GoTo saida Case 1 UF$ = InputBox$("QUAL A UF:") If UF = "ac" Then Selection.TypeText If UF = "al" Then Selection.TypeText If UF = "ap" Then Selection.TypeText If UF = "am" Then Selection.TypeText If UF = "ba" Then Selection.TypeText If UF = "ce" Then Selection.TypeText If UF = "df" Then Selection.TypeText If UF = "es" Then Selection.TypeText If UF = "go" Then Selection.TypeText If UF = "ma" Then Selection.TypeText If UF = "mt" Then Selection.TypeText If UF = "ms" Then Selection.TypeText If UF = "mg" Then Selection.TypeText If UF = "pa" Then Selection.TypeText If UF = "pb" Then Selection.TypeText If UF = "pr" Then Selection.TypeText If UF = "pi" Then Selection.TypeText If UF = "pe" Then Selection.TypeText If UF = "rj" Then Selection.TypeText If UF = "rn" Then Selection.TypeText If UF = "rs" Then Selection.TypeText If UF = "ro" Then Selection.TypeText If UF = "sc" Then Selection.TypeText If UF = "sp" Then Selection.TypeText If UF = "se" Then Selection.TypeText If UF = "to" Then Selection.TypeText GoTo saida Case 2 UF$ = InputBox$("QUAL A UF:") CONTADOR:" & Chr(13) & " 1 - MRS" & Chr(1 " 0-SAIR) "))

("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS ("CRC/RS

049.704/O-S-AC") 049.704/O-S-AL") 049.704/O-S-AP") 049.704/O-S-AM") 049.704/O-S-BA") 049.704/O-S-CE") 049.704/O-S-DF") 049.704/O-S-ES") 049.704/O-S-GO") 049.704/O-S-MA") 049.704/O-S-MT") 049.704/O-S-MS") 049.704/O-S-MG") 049.704/O-S-PA") 049.704/O-S-PB") 049.704/O-S-PR") 049.704/O-S-PI") 049.704/O-S-PE") 049.704/O-S-RJ") 049.704/O-S-RN") 49.704") 049.704/O-S-RO") 049.704/O-S-SC") 049.704/O-S-SP") 049.704/O-S-SE") 049.704/O-S-TO")

If UF = "df" Then Selection.TypeText If UF = "es" Then Selection.TypeText If UF = "go" Then Selection.TypeText If UF = "ma" Then Selection.TypeText If UF = "ms" Then Selection.TypeText If UF = "mg" Then Selection.TypeText If UF = "pa" Then Selection.TypeText If UF = "pr" Then Selection.TypeText If UF = "rj" Then Selection.TypeText If UF = "rn" Then Selection.TypeText If UF = "sc" Then Selection.TypeText If UF = "sp" Then Selection.TypeText If UF = "se" Then Selection.TypeText If UF = "ba" Then Selection.TypeText If UF = "rs" Then Selection.TypeText GoTo saida End Select saida: End Sub Sub sojesussalva() ' ' sojesussalva Macro ' Macro recorded 07/01/09 by guerra '

("CRC/RS 052.113/O-S-DF") ("erro!") ("CRC/RS 52.113/O-0 S-GO") ("CRC/RS 052.113/O-S-MA") ("CRC/RS 052.113/O-S-MS") ("CRC/RS 052.113/O- S-MG") ("CRC -RS - 52113 / O - PA") ("CRC/RS 052.113/O-PR") ("CRC -RS - 52113 / O - S - RJ") ("CRC/RS 052.113/O-S-RN") ("CRC/RS 052.113/0-S SC") ("CRC/RS 052.113/O-S-SP") ("CRC/RS 052.113/O-S-SE") ("CRC/RS 052.113/O-S-BA") ("CRC/RS 052.113/O")

retorna: osd$ = "0" osd$ = InputBox$("DIGITE O N DA OS:") If osd = "0" Then GoTo saida If osd = 1 Then GoTo temp If osd <= 3999 Then GoTo descontinuada If osd >= 15001 Then GoTo p15000160001 If osd >= 14001 Then GoTo p14000150001 If osd >= 13001 Then GoTo p13000140001 If osd >= 12001 Then GoTo p12000130001 If osd >= 11001 Then GoTo p11000120001 If osd >= 10001 Then GoTo p10000110001 If osd >= 9001 Then GoTo p09000100000 If osd >= 8001 Then GoTo p08000090000 If osd >= 7001 Then GoTo p07000080000 If osd >= 6001 Then GoTo p06000070000 If osd >= 5001 Then GoTo p05000060000 If osd >= 4001 Then GoTo p04000050000 p15000160001: sdir = "P:\Arq Trabalho\15001 - 16000\" & GoTo saida p14000150001: sdir = "P:\Arq Trabalho\14001 - 15000\" & GoTo saida p13000140001: sdir = "P:\Arq Trabalho\13001 - 14000\" & GoTo saida p12000130001: sdir = "P:\Arq Trabalho\12001 - 13000\" GoTo saida p11000120001: sdir = "P:\Arq Trabalho\11001 - 12000\" & GoTo saida p10000110001: sdir = "P:\Arq Trabalho\10001 - 11000\" &

osd osd osd & osd osd osd

GoTo saida p09000100000: osd = "0" & osd sdir = "P:\Arq Trabalho\09001 - 10000\" & osd GoTo saida p08000090000: osd = "0" & osd sdir = "P:\Arq Trabalho\08001 - 09000\" & osd GoTo saida p07000080000: osd = "0" & osd sdir = "P:\Arq Trabalho\07001 - 08000\" & osd GoTo saida p06000070000: osd = "0" & osd sdir = "P:\Arq Trabalho\06001 - 07000\" & osd GoTo saida p05000060000: osd = "0" & osd sdir = "P:\Arq Trabalho\05001 - 06000\" & osd GoTo saida p04000050000: osd = "0" & osd sdir = "P:\Arq Trabalho\04000 - 05000\" & osd GoTo saida temp: sdir = "t:" GoTo saida descontinuada: With Application.Assistant Select Case _ .DoAlert( _ "AVISO DE PASTAS ANTIGAS", _ "ESTA PASTA ANTIGA E FOI ARQUIVADA." & Chr(13) & "FALE COM O ADMINIS TRADOR." & Chr(13) & "DESEJA SALAR EM OUTRA", _ msoAlertButtonYesNo, _ msoAlertIconCritical, _ msoAlertDefaultSecond, _ msoAlertCancelFirst, _ False) Case vbYes: GoTo retorna Case vbNo: GoTo saida End Select End With GoTo saida saida: osnome$ = InputBox$("Nome do Arquivo:") ffnm = osd & osnome ChangeFileOpenDirectory sdir ActiveDocument.SaveAs FileName:=ffnm, _ FileFormat:=wdFormatDocument, LockComments:=False, Password:="", _ AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _ EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _ :=False, SaveAsAOCELetter:=False End Sub

Sub att() ' ' att Macro ' Macro recorded 23/06/09 by pericia02 ' ActiveDocument.Fields.Update Application.ScreenUpdating = True ActiveWindow.View.Type = wdNormalView ActiveWindow.View.Type = wdPrintView With ActiveDocument.Styles(wdStyleNormal).Font If .NameFarEast = .NameAscii Then .NameAscii = "" End If .NameFarEast = "" End With With ActiveDocument.PageSetup .LineNumbering.Active = False .Orientation = wdOrientPortrait .TopMargin = CentimetersToPoints(3.3) .BottomMargin = CentimetersToPoints(2) .LeftMargin = CentimetersToPoints(2.5) .RightMargin = CentimetersToPoints(3) .MirrorMargins = False End With saida: Application.ScreenUpdating = True End Sub Sub Lem7() ' ' Lememo Macro ' Macro gravada 29/01/08 por SCA 'LEMBRETE: COLOCAR O PONTEIRO '0 valor Do While contador <> 12 lc = "" 'limpa leiruta de caractere' lcs = 0 'limpa tamnaho do texto' Do While lc <> vbTab Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend lc = Selection.Text Selection.MoveRight Unit:=wdCharacter, Count:=1 lcs = lcs + 1 Loop Selection.MoveLeft Unit:=wdCharacter, Count:=lcs, Extend:=wdExtend Selection.Delete contador = contador + 1 Loop Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend Selection.Delete Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend Selection.Delete 'ABASTECE A PLANILHA Dim PLANILHA(13) As String Dim vR As Integer Do While contador2 <> 13 lc = "" 'limpa leiruta de caractere' lcs = 0 'limpa tamnaho do texto' Do While lc <> vbTab Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend

lc = Selection.Text Selection.MoveRight Unit:=wdCharacter, Count:=1 lcs = lcs + 1 Loop Selection.MoveLeft Unit:=wdCharacter, Count:=1 Selection.MoveLeft Unit:=wdCharacter, Count:=lcs - 1, Extend:=wdExtend vR = vR + 1 PLANILHA(vR) = Selection.Text Selection.Delete Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend Selection.Delete contador2 = contador2 + 1 Loop 'Do While lRp <> 13 'lRp = lRp + 1 'Selection.TypeText Text:=PLANILHA(lRp) 'Selection.TypeParagraph 'Loop Voriginal = PLANILHA(3) Atualizado = PLANILHA(12) Tjuros = PLANILHA(11) MultaP = PLANILHA(10) Juros3 = PLANILHA(9) juros2 = PLANILHA(8) juros1 = PLANILHA(7) Corrigido = PLANILHA(6) ate = PLANILHA(5) Descr = PLANILHA(4) Unid = PLANILHA(2) desde = PLANILHA(1) 'Clculos Vcorr = CCur(Corrigido) - CCur(Voriginal) VCP = CDec((Vcorr / CCur(Voriginal)) * 100) VCPA = Round(VCP, 4) 'Sada tabela If juros2 = "0,00" Then 'define n. linhas XC = 6 Else XC = 7 End If Selection.TypeParagraph ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=XC, NumColumns: = _ 3, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _ wdAutoFitContent With Selection.Tables(1) 'If .Style <> "Table Grid" Then '.Style = "Table Grid" 'End If .ApplyStyleHeadingRows = True .ApplyStyleLastRow = True .ApplyStyleFirstColumn = True .ApplyStyleLastColumn = True End With Selection.MoveDown Unit:=wdLine, Count:=4, Extend:=wdExtend Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend

With Selection.Tables(1) With .Borders(wdBorderLeft) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderRight) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderTop) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderBottom) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderHorizontal) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth075pt .Color = wdColorAutomatic End With With .Borders(wdBorderVertical) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth075pt .Color = wdColorAutomatic End With .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone .Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone .Borders.Shadow = False End With With Options .DefaultBorderLineStyle = wdLineStyleSingle .DefaultBorderLineWidth = wdLineWidth150pt .DefaultBorderColor = wdColorAutomatic End With Selection.Tables(1).Rows.Alignment = wdAlignRowCenter Selection.MoveDown Unit:=wdLine, Count:=1 Selection.MoveUp Unit:=wdLine, Count:=5 'posiciona na primeira clila da linha 1 'DESCRIO Selection.MoveRight Unit:=wdCharacter, Count:=3, Extend:=wdExtend Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.Cells.Merge With Selection.Font .Name = "Arial" .Size = 10 .Bold = True .Italic = False .Underline = wdUnderlineNone .UnderlineColor = wdColorAutomatic .StrikeThrough = False .DoubleStrikeThrough = False .Outline = False .Emboss = False .Shadow = False

.Hidden = False .SmallCaps = False .AllCaps = False .Color = wdColorAutomatic .Engrave = False .Superscript = False .Subscript = False .Spacing = 0 .Scaling = 100 .Position = 0 .Kerning = 0 .Animation = wdAnimationNone End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("Valor Atualizado - " & Descr) 'DESCRIO 2 Selection.MoveDown Unit:=wdLine, Count:=1 Selection.MoveLeft Unit:=wdCell, Count:=2 With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("Item") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("Descrio") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText (" Valor") 'VALOR PRINCIPAL Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("1") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText ("Saldo em " & desde) Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial"

.Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText (Unid & " " & Voriginal) 'CORREO Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("2") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText ("Correo Monetria (" & VCPA & "%) desde " & desde & " at " & ate) Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText FormatCurrency(Vcorr) 'JUROS 0,5% If juros2 <> "0,00" Then Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("3") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText ("Juros de 0,5% a. m. - de " & desde & " at 09/01/03") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText FormatCurrency(juros1) 'JUROS 1,0% Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("4")

Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText ("Juros de 1% a. m. - de 10/01/03 at " & ate) Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText FormatCurrency(juros2) 'ATUALIZADO Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("5") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText ("Valor Atualizado (1+2+3+4) em " & ate) Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText FormatCurrency(CCur(Atualizado)) End If If juros2 = "0,00" Then 'JUROS 1% Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("3") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText ("Juros Legais - de " & desde & " at " & ate) Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial"

.Size = 10 End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText FormatCurrency(juros1) 'ATUALIZADO Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText ("4") Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText ("Valor Atualizado (1+2+3) em " & ate) Selection.MoveRight Unit:=wdCell With Selection.Font .Name = "Arial" .Size = 10 .Bold = True End With Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.TypeText FormatCurrency(CCur(Atualizado)) End If End Sub Sub TabelaPE() ' ' PE Macro ' Macro gravada 11/01/10 por Diego ' Selection.Tables(1).Select With Selection.Tables(1) .TopPadding = CentimetersToPoints(0) .BottomPadding = CentimetersToPoints(0) .LeftPadding = CentimetersToPoints(0.05) .RightPadding = CentimetersToPoints(0.05) .Spacing = 0 .AllowPageBreaks = True .AllowAutoFit = True End With Selection.Tables(1).Rows.LeftIndent = CentimetersToPoints(2) Selection.Tables(1).PreferredWidthType = wdPreferredWidthAuto Selection.Tables(1).PreferredWidth = 0 Selection.Rows.HeightRule = wdRowHeightAuto Selection.Rows.Height = CentimetersToPoints(0) Selection.Columns.PreferredWidthType = wdPreferredWidthAuto Selection.Columns.PreferredWidth = 0 Selection.Cells.PreferredWidthType = wdPreferredWidthAuto Selection.Cells.PreferredWidth = 0 With Selection.Tables(1) 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 With .Borders(wdBorderHorizontal) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth050pt .Color = wdColorAutomatic End With .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone .Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone .Borders.Shadow = False End With With Selection.Sections(1) .Borders(wdBorderLeft).LineStyle = wdLineStyleNone .Borders(wdBorderRight).LineStyle = wdLineStyleNone .Borders(wdBorderTop).LineStyle = wdLineStyleNone .Borders(wdBorderBottom).LineStyle = wdLineStyleNone With .Borders .DistanceFrom = wdBorderDistanceFromPageEdge .AlwaysInFront = True .SurroundHeader = True .SurroundFooter = True .JoinBorders = False .DistanceFromTop = 24 .DistanceFromLeft = 24 .DistanceFromBottom = 24 .DistanceFromRight = 24 .Shadow = False .EnableFirstPageInSection = True .EnableOtherPagesInSection = True .ApplyPageBordersToAllSections End With End With With Options .DefaultBorderLineStyle = wdLineStyleSingle .DefaultBorderLineWidth = wdLineWidth050pt .DefaultBorderColor = wdColorAutomatic End With With Selection.Tables(1) With .Borders(wdBorderLeft) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderRight)

.LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderTop) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderBottom) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With .Borders(wdBorderHorizontal).LineStyle = wdLineStyleNone .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone .Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone .Borders.Shadow = False End With With Options .DefaultBorderLineStyle = wdLineStyleSingle .DefaultBorderLineWidth = wdLineWidth150pt .DefaultBorderColor = wdColorAutomatic End With With Selection.Cells With .Borders(wdBorderLeft) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderRight) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderTop) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderBottom) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderHorizontal) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth075pt .Color = wdColorAutomatic End With With .Borders(wdBorderVertical) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth075pt .Color = wdColorAutomatic End With .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone .Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone .Borders.Shadow = False End With With Options

.DefaultBorderLineStyle = wdLineStyleSingle .DefaultBorderLineWidth = wdLineWidth150pt .DefaultBorderColor = wdColorAutomatic End With End Sub

You might also like