S
Sean McPoland
I have a document that is 1000+1 textboxes, and want to untextbox it...the
following macro works but does not duplicate the paragraph format as I think
it should...
advice much appreciated.
Sub unFrameWholeDocument()
Dim rngParagraph As Range
Dim tmpParagraph As Range
Dim cnlParagraph As Range
Dim pPar As Word.Paragraph
Set rngParagraph = Nothing
ActiveDocument.Bookmarks("\StartOfDoc").Select
SourceName = ActiveDocument.Name
Documents.Add Visible:=True
DestName = ActiveDocument.Name
Text = ""
paraI = 0
Documents(SourceName).Select
For Each pPar In ActiveDocument.Paragraphs
paraI = paraI + 1
Set rfrmtb = ActiveDocument.Paragraphs(paraI).Format.Duplicate
ttext = ActiveDocument.Paragraphs(paraI).Range
Documents(DestName).Select
ActiveDocument.Bookmarks("\EndOfDoc").Select
ActiveDocument.Paragraphs.Add
ActiveDocument.Paragraphs(paraI).Range = ttext
ActiveDocument.Paragraphs(paraI).Format = rfrmtb
'Selection.Paragraphs.Format = rfrmtb
Documents(SourceName).Select
Next pPar
End Sub
TIA
Sean
following macro works but does not duplicate the paragraph format as I think
it should...
advice much appreciated.
Sub unFrameWholeDocument()
Dim rngParagraph As Range
Dim tmpParagraph As Range
Dim cnlParagraph As Range
Dim pPar As Word.Paragraph
Set rngParagraph = Nothing
ActiveDocument.Bookmarks("\StartOfDoc").Select
SourceName = ActiveDocument.Name
Documents.Add Visible:=True
DestName = ActiveDocument.Name
Text = ""
paraI = 0
Documents(SourceName).Select
For Each pPar In ActiveDocument.Paragraphs
paraI = paraI + 1
Set rfrmtb = ActiveDocument.Paragraphs(paraI).Format.Duplicate
ttext = ActiveDocument.Paragraphs(paraI).Range
Documents(DestName).Select
ActiveDocument.Bookmarks("\EndOfDoc").Select
ActiveDocument.Paragraphs.Add
ActiveDocument.Paragraphs(paraI).Range = ttext
ActiveDocument.Paragraphs(paraI).Format = rfrmtb
'Selection.Paragraphs.Format = rfrmtb
Documents(SourceName).Select
Next pPar
End Sub
TIA
Sean