Saturday, April 24, 2010

How to Convert Automatic Hyphens to Manual Hyphens using Word VBA

Word does automatic hyphenation at the end of line when the AutomaticHyphenation feature is turned on

ActiveDocument.AutoHyphenation = True 

For example, in the pic below, the word has hyphenated non-breaking automatically



You can test it by try selecting the Hyphen (which is not there physically)

The following code converts all automatic hyphens to manual ones

ActiveDocument.ConvertAutoHyphens

1 comment:

  1. Anonymous1:19 AM

    Word crashes if I use ConvertAutohyphens in a DOCX with footnotes. Any idea? Thanks

    ReplyDelete

StumbleUpon
Share on Facebook
Related Posts Plugin for WordPress, Blogger...

Visual Basic for Applications (VBA) Forum (recent threads)

CodeKeep VBA Feed

Visual Studio Tools for Office Forum (recent threads)

Download Windows Live Toolbar and personalize your Web experience! Add custom buttons to get the information you care about most.

Office Business Applications (OBA) Team Blog

MSDN Code Gallery Published Resources For Tag VSTO

microsoft.public.vsnet.vstools.office Google Group