Sub HyphenateFrameTTG() ' ' HyphenateFrameTTG ' ' VBA macro for use with Corel DRAW 11 for Windows (may work with DRAW 10 as well) ' Hyphenates selected paragraph text frame using Microsoft Word hyphenation algorithms ' Requires Microsoft Word 2000 or higher ' Copyright (c) 2002-10-21 by Adam Twardoch/TTG ' Version 1.0b1 Dim frame As Shape Dim wd As Object Dim frameWidth As Single Set frame = ActiveSelection.Shapes(1) frameWidth = frame.AbsoluteHScale * 10 frame.Text.Story.Copy fmtFont = frame.Text.Story.Font Set wd = CreateObject("Word.Application") With wd .Visible = False .Documents.Add .ActiveDocument.PageSetup.PageHeight = .CentimetersToPoints(29.7) .ActiveDocument.PageSetup.PageWidth = .CentimetersToPoints(21) .ActiveDocument.PageSetup.LeftMargin = .CentimetersToPoints(2) .ActiveDocument.PageSetup.RightMargin = .CentimetersToPoints(21 - 2 - frameWidth) .Selection.PasteAndFormat (0) .Selection.WholeStory .Selection.ParagraphFormat.Alignment = 3 .Selection.Font.Name = frame.Text.Story.Font .Selection.Font.Size = frame.Text.Story.Size .Selection.Font.Bold = frame.Text.Story.Bold .Selection.Font.Italic = frame.Text.Story.Italic .ActiveDocument.AutoHyphenation = True .ActiveDocument.HyphenateCaps = True .ActiveDocument.HyphenationZone = .CentimetersToPoints(0.75) .ActiveDocument.ConsecutiveHyphensLimit = 0 .Selection.Find.ClearFormatting .Selection.Find.Replacement.ClearFormatting .Selection.Find.Text = "-" .Selection.Find.Replacement.Text = ChrW(713) .Selection.Find.Forward = True .Selection.Find.Wrap = 1 .Selection.Find.Format = False .Selection.Find.Execute Replace:=2 .Selection.WholeStory .Selection.Copy .Selection.PasteAndFormat (22) .Selection.WholeStory .Selection.Find.ClearFormatting .Selection.Find.Replacement.ClearFormatting .Selection.Find.Text = "-" .Selection.Find.Replacement.Text = "-^l" .Selection.Find.Forward = True .Selection.Find.Wrap = 1 .Selection.Find.Format = False .Selection.Find.Execute Replace:=2 .Selection.Find.ClearFormatting .Selection.Find.Replacement.ClearFormatting .Selection.Find.Text = ChrW(713) .Selection.Find.Replacement.Text = "-" .Selection.Find.Forward = True .Selection.Find.Wrap = 1 .Selection.Find.Format = False .Selection.Find.Execute Replace:=2 .Selection.WholeStory .Selection.Copy .ActiveDocument.Close (False) End With frame.Text.Story.Paste Set wd = Nothing End Sub