Bonjour,
J'ai essayé de bricoler une macro mais elle ne fonctionne pas.
Pourriez-vous m'indiquer mes erreurs SVP ?
3 étapes dans un fichier .odt
1. remplacer 2 fins de paragraphe (\p\p) par un saut de ligne manuel (\n)
2. remplacer 1 saut de ligne (\p) par une espace ( )
3. remplacer  saut de ligne manuel (\n) par 1 fin de paragraphe (\p)
Merci
sub n_p
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(5) as new com.sun.star.beans.PropertyValue
rem -- remplacer \p\p par saut de ligne manuel--
args1(0).Name = "SearchItem.SearchString"
args1(0).Value = "\p\p"
args1(1).Name = "SearchItem.ReplaceString"
args1(1).Value = "\n"
rem -- remplacer \p par \s --
args1(2).Name = "SearchItem.SearchString"
args1(2).Value = "\p"
args1(3).Name = "SearchItem.ReplaceString"
args1(3).Value = " "
rem -- remplacer \n par \p --
args1(4).Name = "SearchItem.SearchString"
args1(4).Value = "\n"
args1(5).Name = "SearchItem.ReplaceString"
args1(5).Value = "\p"
dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args1())
end sub
--
Cordialement
Sandy-Pascal Andriant
--
Envoyez un mail à users+unsubscribe@fr.libreoffice.org pour vous désinscrire
Les archives de la liste sont disponibles à https://listarchives.libreoffice.org/fr/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Context
- [fr-users] Macro à corriger SVP · sandy andriant
 
   
 
  Privacy Policy |
  
Impressum (Legal Info) |
  
Copyright information: Unless otherwise specified, all text and images
  on this website are licensed under the
  
Creative Commons Attribution-Share Alike 3.0 License.
  This does not include the source code of LibreOffice, which is
  licensed under the Mozilla Public License (
MPLv2).
  "LibreOffice" and "The Document Foundation" are
  registered trademarks of their corresponding registered owners or are
  in actual use as trademarks in one or more countries. Their respective
  logos and icons are also subject to international copyright laws. Use
  thereof is explained in our 
trademark policy.