Jan, Thanks for that - I'm delighted that all is now well.

Here is the position.

After much experimenting - including my purchasing Wordperfect and
installing Open Office, I think we (myself and all the other
contributors to this topic) have concluded that it is the formatting
of the RTF by Legacy that is incorrect. The placing of the pictures is
erratic, and one has these odd brackets and so on in the captions and
descriptions.

So I have written two macros. The first goes through the whole
document removing all square brackets and odd spaces etc. and also the
word 'caption. As it is named - run that one forst.

The second finds each picture, and centres it and the captions and
descriptions, and also ties the pictures and captions etc together so
that they cannot be split over a page break.

Here's the instructions:-
1. Create an RTF
2. With it open, go Tools - Macro - Visual Basic Editor (Alt F11)
3. Paste the code
4. File - Save normal

5. Tools - Customize - Keyboard
6. Scroll down Categories to Macros
7. Select Legacy_pics_n_descrips, and press Alt-Z or whatever you choose.
8. Close and close again
9. Make sure you are at the start of the document
10. Tools - Macro - Macros
11 Run Legacy_captions_run_first
12. Press the selected key to run the Legacy_pics_n_descrips macro - e.g. Alt-Z
or whatever you chose
13. Repeat pressing your selected keystroke (e.g Alt-Z) to keep going
to the next picture. Watch out, because it will go back to the
beginning and start again putting them back where they started.

Here's the code:-
_________________________________________________________________

Sub Legacy_Captions_run_first()
'
' Legacy Captions_run_first Macro
' Macro recorded 17/10/2006 by Alastair Lack
' Removes 'Caption' and 'Description' brackets throughout the document
'
  Selection.Find.ClearFormatting
  With Selection.Find
      .Text = "["
      .Replacement.Text = ""
      .Forward = True
      .Wrap = wdFindContinue
      .Format = False
      .MatchCase = False
      .MatchWholeWord = False
      .MatchWildcards = False
      .MatchSoundsLike = False
      .MatchAllWordForms = False
  End With
  Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
  Selection.Find.ClearFormatting
  With Selection.Find
      .Text = "]"
      .Replacement.Text = ""
      .Forward = True
      .Wrap = wdFindContinue
      .Format = False
      .MatchCase = False
      .MatchWholeWord = False
      .MatchWildcards = False
      .MatchSoundsLike = False
      .MatchAllWordForms = False
  End With
  Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
  Selection.HomeKey Unit:=wdStory
  Selection.Find.ClearFormatting
  Selection.Find.Replacement.ClearFormatting
  With Selection.Find
      .Text = "[ Caption: "
      .Replacement.Text = ""
      .Forward = True
      .Wrap = wdFindContinue
      .Format = False
      .MatchCase = False
      .MatchWholeWord = False
      .MatchWildcards = False
      .MatchSoundsLike = False
      .MatchAllWordForms = False
  End With
  Selection.Find.Execute Replace:=wdReplaceAll
  With Selection.Find
      .Text = "[ Description: "
      .Replacement.Text = ""
      .Forward = True
      .Wrap = wdFindContinue
      .Format = False
      .MatchCase = False
      .MatchWholeWord = False
      .MatchWildcards = False
      .MatchSoundsLike = False
      .MatchAllWordForms = False
  End With
  Selection.Find.Execute Replace:=wdReplaceAll
  With Selection.Find
      .Text = " ]"
      .Replacement.Text = ""
      .Forward = True
      .Wrap = wdFindContinue
      .Format = False
      .MatchCase = False
      .MatchWholeWord = False
      .MatchWildcards = False
      .MatchSoundsLike = False
      .MatchAllWordForms = False
  End With
  Selection.Find.Execute Replace:=wdReplaceAll
End Sub

Sub Legacy_pics_n_descrips()
'
' Legacy_pics_n_descrips Macro
' Macro recorded 1/11/2006 by Alastair Lack
' Centres pictures and captions underneath them

   Selection.Find.ClearFormatting
   With Selection.Find
       .Text = "^g"
       .Replacement.Text = ""
       .Forward = True
       .Wrap = wdFindContinue
       .Format = False
       .MatchCase = False
       .MatchWholeWord = False
       .MatchWildcards = False
       .MatchSoundsLike = False
       .MatchAllWordForms = False
   End With
   Selection.Find.Execute
   Selection.MoveDown Unit:=wdLine, Count:=5, Extend:=wdExtend
   With Selection.ParagraphFormat
       .LeftIndent = CentimetersToPoints(1.92)
       .SpaceBeforeAuto = False
       .SpaceAfterAuto = False
   End With
   With Selection.ParagraphFormat
       .SpaceBeforeAuto = False
       .SpaceAfterAuto = False
       .FirstLineIndent = CentimetersToPoints(0)
   End With
   With Selection.ParagraphFormat
       .LeftIndent = CentimetersToPoints(0)
       .SpaceBeforeAuto = False
       .SpaceAfterAuto = False
   End With
   Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
   Selection.Font.Bold = wdToggle
   If Selection.Font.Underline = wdUnderlineNone Then
      Selection.Font.Underline = wdUnderlineSingle
   Else
      Selection.Font.Underline = wdUnderlineNone
   End If
   With Selection.ParagraphFormat
       .LeftIndent = CentimetersToPoints(0)
       .RightIndent = CentimetersToPoints(0)
       .SpaceBefore = 0
       .SpaceBeforeAuto = False
       .SpaceAfter = 0
       .SpaceAfterAuto = False
       .LineSpacingRule = wdLineSpaceSingle
       .Alignment = wdAlignParagraphCenter
       .WidowControl = True
       .KeepWithNext = True
       .KeepTogether = True
       .PageBreakBefore = False
       .NoLineNumber = False
       .Hyphenation = True
       .FirstLineIndent = CentimetersToPoints(0)
       .OutlineLevel = wdOutlineLevelBodyText
       .CharacterUnitLeftIndent = 0
       .CharacterUnitRightIndent = 0
       .CharacterUnitFirstLineIndent = 0
       .LineUnitBefore = 0
       .LineUnitAfter = 0
   End With
   Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub


Legacy User Group guidelines can be found at: 
http://www.LegacyFamilyTree.com/Etiquette.asp

To find past messages, please go to our searchable archives at: 
http://www.mail-archive.com/[email protected]/

For online technical support, please visit 
http://www.LegacyFamilyTree.com/Help.asp

To unsubscribe please visit: http://www.LegacyFamilyTree.com/LegacyLists.asp


Reply via email to