Jump to content

VB Macros Help Please!

- - - - -

  • Please log in to reply
No replies to this topic

#1
Johnathanx

Johnathanx

    Newbie

  • Members
  • Pip
  • 2 posts
Hi all,

I'm looking for some help with Microsoft Word and writing Macros.

I'm trying to use VB to remove two logos from a Word document.

I have been trying use the following code with no such luck:

Sub RPSAfterDetails()


Selection.HomeKey Unit:=wdStory

For x = 1 To ActiveDocument.Content.ShapeRange.Count

ActiveDocument.Content.ShapeRange(x).Select

    

    With Selection.Find
        
        .ClearFormatting
        
        .Replacement.ClearFormatting
                
        .Text = "^g"

        .Replacement.Text = ""

        .Forward = True

        .Wrap = wdFindContinue

        .Format = False

        .MatchCase = False

        .MatchWholeWord = False

        .MatchWildcards = False

        .MatchSoundsLike = False

        .MatchAllWordForms = False

    End With

    Do

        Selection.Find.Execute

        If Selection.Text = rmlogo Or s1logo Then

        Selection.Delete Unit:=wdCharacter, Count:=1

    Else
      
    End If

    Loop While Selection.Find.Found

Next x

End Sub


Sub RemoveLogos() ActiveDocument.Shapes("s1-logo").Select Selection.ShapeRange.Delete ActiveDocument.Shapes("logo-rightmove_bigger").Select Selection.ShapeRange.Delete End Sub


Any help at all would be greatly appreciated,

Thanks.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users