Jump to content
We've recently updated our Privacy Statement, available here ×

dheinst

Members
  • Posts

    1
  • Joined

  • Last visited

dheinst's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. 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
×
×
  • Create New...