Jump to content
Fórum Script Brasil
  • 0

Migrar macro de VBA Word para OOo Basic Writer


KhanBR

Question

Boa tarde, 

Aguem pode me dar uma dica de como converter VBA para OOo Basic Wrtier

' Inserindo a TAG #INICIO#
    Selection.HomeKey unit:=wdStory
    If Selection.Range.Tables.Count > 0 Then
        Selection.SplitTable
    End If
    Selection.Range.InsertParagraph
    Selection.HomeKey unit:=wdStory
    Selection.Style = -1
    ActiveDocument.Range.InsertBefore "#INICIO#"
               
    ' Inserindo a TAG #FIM#
    Selection.EndKey unit:=wdStory
    Selection.Range.InsertParagraph
    Selection.EndKey unit:=wdStory
    Selection.Style = -1
    Selection.Range.InsertAfter "#FIM#"
    
    ' Formatando o Estilo dos paragrafos
    For i = 1 To ActiveDocument.Paragraphs.Count
        If ActiveDocument.Paragraphs(i).Style.NameLocal <> "Normal" Then
            ActiveDocument.Paragraphs(i).Style = -1
            ActiveDocument.Paragraphs(i).Alignment = wdAlignParagraphJustify
        End If
    Next

    Exit Sub
    
Erro:
    If Err.Description <> "" Then
        MsgBox ("Falha na formatação da matéria. " & Err.Description)
        Exit Sub
    End If
    
ErroTabela:
    If Err.Description <> "" Then
        MsgBox ("Falha na formatação de tabela: " & Err.Description & "." & " Verifique a estrutura da tabela!")
        Exit Sub
    End If

End Sub
 

 

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.



  • Forum Statistics

    • Total Topics
      148691
    • Total Posts
      644531
×
×
  • Create New...