![]() |
#7
|
||||
|
||||
![]()
Not sure why it's missing. Try:
Code:
Sub Demo() Application.ScreenUpdating = False With ActiveDocument.Range .Font.Hidden = True With .Find .ClearFormatting .Replacement.ClearFormatting .Format = True .Font.Hidden = True .Replacement.Font.Hidden = False .Forward = True .MatchWildcards = True .Wrap = wdFindContinue .Text = "\<xs:element name[!\>]@\>" .Replacement.Text = "^&" .Execute Replace:=wdReplaceAll .Format = False .Text = "m[ai][nx]Occurs[!\>]@\>" .Replacement.Text = ">" .Execute Replace:=wdReplaceAll .Text = "\<xs:element name=([!\>]@)type=([!\>]@)\>" .Replacement.Text = "\1^t\2^p" .Execute Replace:=wdReplaceAll .Text = "\<xs:element name=([!\>]@)\>" .Replacement.Text = "\1^t^p" .Execute Replace:=wdReplaceAll .Text = " ([^13^t])" .Replacement.Text = "\1" .Execute Replace:=wdReplaceAll .Text = Chr(34) .Replacement.Text = "" .Execute Replace:=wdReplaceAll End With End With With ActiveDocument.Range .Cut .PasteSpecial DataType:=wdPasteText With .Find .MatchWildcards = True .Wrap = wdFindContinue .Text = "^13[ ^t]*^13" .Replacement.Text = "^p" .Execute Replace:=wdReplaceAll .Text = "[^13]{2,}" .Replacement.Text = "^p" .Execute Replace:=wdReplaceAll End With End With With ActiveDocument.Range If .Characters.First <> vbCr Then .InsertBefore vbCr .InsertBefore "NAME" & vbTab & "TYPE" .ConvertToTable vbTab, 2 End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
extract, parens |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Extract name and address. | donlincolnmsof | Word VBA | 1 | 11-10-2017 12:59 PM |
VBA code to extract strings | twozedz | Excel Programming | 1 | 05-15-2016 06:00 AM |
Extract tables as images | didijaba | Word VBA | 2 | 05-06-2014 06:14 PM |
Extract Photographs | The Gap | PowerPoint | 4 | 04-22-2010 07:00 AM |
Extract from String using Wildcard | whousedmy | Word | 0 | 05-21-2009 01:35 AM |