Consulting

Results 1 to 2 of 2

Thread: add text after second word after fullfill condition

  1. #1
    VBAX Regular
    Joined
    Jan 2018
    Posts
    36
    Location

    add text after second word after fullfill condition

    Hi, I need a code which add text after second word after fullfill condition but the syntax: oPara.Font.Size = 9 is not working, please, write me correct



    Sub add_after_xml()
    
    
                  Dim oPara As Paragraph
        For Each oPara In ActiveDocument.Paragraphs
                
    If Len(oPara.Range.Text) > 1 And oPara.Font.Size = 9 Then 
        With oPara.Range.Words(2)
                    .InsertAfter "</Bold:bb>"
                    .Collapse 0
        End With
    
    
    End If
    
    
            
        Next oPara
    End Sub
    Cheers
    Karol

  2. #2
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    2,866
    Location
    If Len(oPara.Range.Text) > 1 And oPara.Range.Font.Size = 9 Then
    Greg

    Visit my website: http://gregmaxey.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •