dheinst Posted January 7, 2009 Share Posted January 7, 2009 After saving a report as Word document, I'm stuck with all non-expading floating textboxes. This prevents end users from editing the final report after generating it. Reading through the forum, there seem to be more people with this, without any clues for some kind of solution.I'm trying to create a Word macro to convert my document to something editable. I don't have a good solution at this point (not sure if it will ever be possible to do it this way), but maybe others might have some use for the macro thus far. Any improvements are ofcourse welcome :-)Code:Sub FixDoc() 'Convert textbox text to frames Dim oShp As Shape Dim i As Integer For Each oShp In ActiveDocument.Shapes If Left$(oShp.AlternativeText, 8) = "Text Box" Then oShp.ConvertToFrame Else If Left$(oShp.Name, 4) = "Line" Then Else If oShp.AutoShapeType = msoShapeMixed Then oShp.ConvertToInlineShape Else oShp.Delete End If End If End If Next oShp 'Delete frames For i = ActiveDocument.Frames.Count To 1 Step -1 With ActiveDocument.Frames(i) .Borders.Enable = False With .Shading .Texture = wdTextureNone .ForegroundPatternColor = wdColorAutomatic .BackgroundPatternColor = wdColorAutomatic End With .Delete End With Next 'Set document margins With ActiveDocument.PageSetup .TopMargin = CentimetersToPoints(1.14) .BottomMargin = CentimetersToPoints(2.34) .LeftMargin = CentimetersToPoints(1.3) .RightMargin = CentimetersToPoints(1.3) End WithEnd Sub Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now