Sub CV() ' ' CV Macro ' Macro grabada el 23/07/2006 por Alexander Gelbukh ' ActiveDocument.Save Selection.WholeStory Selection.Fields.Update Selection.WholeStory Selection.Fields.Update Selection.WholeStory Selection.Fields.Update ActiveDocument.Save ChangeFileOpenDirectory "C:\Gelbukh\Doc\CV\WWW\~gelbukh\CV\" ActiveDocument.SaveAs FileName:="CV.htm", FileFormat:=wdFormatFilteredHTML _ , LockComments:=False, Password:="", AddToRecentFiles:=False, _ WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _ SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _ False ActiveWindow.View.Type = wdWebView Selection.HomeKey Unit:=wdStory Selection.GoTo What:=wdGoToField, Which:=wdGoToNext, Count:=1, Name:="toc" Selection.Find.ClearFormatting With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = False .CorrectHangulEndings = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Fields.ToggleShowCodes Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend Selection.Delete Unit:=wdCharacter, Count:=1 Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _ "toc \o \h \z \* MERGEFORMAT", PreserveFormatting:=True ' The following is needed for the icons at the top left to appear: ' they only appear in HTM and only after fields update ' After this first update they appear and no need to update it again for other languages ' since we do not leave the HTM view. Selection.WholeStory Selection.Fields.Update ActiveDocument.Save ActiveWindow.View.Type = wdWebView ActiveDocument.SaveAs FileName:="CV-English.htm", FileFormat:= _ wdFormatFilteredHTML, LockComments:=False, Password:="", AddToRecentFiles _ :=False, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts _ :=False, SaveNativePictureFormat:=False, SaveFormsData:=False, _ SaveAsAOCELetter:=False ActiveWindow.View.Type = wdWebView Selection.WholeStory Selection.Fields.Update Selection.WholeStory Selection.Fields.Update Selection.WholeStory Selection.Fields.Update Selection.HomeKey Unit:=wdStory Selection.GoTo What:=wdGoToField, Which:=wdGoToNext, Count:=1, Name:="toc" Selection.Find.ClearFormatting With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = False .CorrectHangulEndings = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Fields.ToggleShowCodes Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend Selection.Delete Unit:=wdCharacter, Count:=1 Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _ "toc \o \h \z \* MERGEFORMAT", PreserveFormatting:=True ActiveDocument.Save ActiveWindow.View.Type = wdWebView ActiveDocument.SaveAs FileName:="CV-Russian.htm", FileFormat:= _ wdFormatFilteredHTML, LockComments:=False, Password:="", AddToRecentFiles _ :=False, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts _ :=False, SaveNativePictureFormat:=False, SaveFormsData:=False, _ SaveAsAOCELetter:=False ActiveWindow.View.Type = wdWebView Selection.WholeStory Selection.Fields.Update Selection.WholeStory Selection.Fields.Update Selection.WholeStory Selection.Fields.Update Selection.HomeKey Unit:=wdStory Selection.GoTo What:=wdGoToField, Which:=wdGoToNext, Count:=1, Name:="toc" Selection.Find.ClearFormatting With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = False .CorrectHangulEndings = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Fields.ToggleShowCodes Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend Selection.Delete Unit:=wdCharacter, Count:=1 Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _ "toc \o \h \z \* MERGEFORMAT", PreserveFormatting:=True ' This is for the same file later to open in Print View. Not sure if really works. ActiveWindow.View.Type = wdPrintView ActiveDocument.Save End Sub