Guest User

autoReplaceStringPlaceholdersWithSymbols

a guest
Dec 30th, 2013
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function autoReplaceStringPlaceholdersWithSymbolsLoop(stringText, charCode)
  2.     ActiveDocument.Content.Find.ClearFormatting
  3.     ActiveDocument.Content.Find.Replacement.ClearFormatting
  4.     With ActiveDocument.Content.Find
  5.         .Text = stringText
  6.         .Replacement.Text = ChrW(charCode)
  7.         .Forward = True
  8.         .Wrap = wdFindContinue
  9.         .Format = False
  10.         .MatchCase = True
  11.         .MatchWholeWord = False
  12.         .MatchWildcards = False
  13.         .MatchSoundsLike = False
  14.         .MatchAllWordForms = False
  15.         .Execute Replace:=wdReplaceAll
  16.     End With
  17.    
  18.     autoReplaceStringPlaceholdersWithSymbolsLoop = 0
  19. End Function
  20.  
  21. Sub autoReplaceStringPlaceholdersWithSymbols()
  22. '
  23. ' autoReplaceStringPlaceholdersWithSymbols Macro
  24. '
  25. '
  26. Dim textSymbolPairList As Variant
  27. Dim someNumber As Integer
  28.  
  29. textSymbolPairList = Array(Array("tOP", 8868), Array("bOT", 8869), Array("nOT", 172), Array("aND", 8743), Array("oR", 8744), Array("rIMPLIES", 8658), Array("lIMPLIES", 8656), Array("uNEQUALS", 8800), Array("mULT", 215), Array("inputCHECK", 8730), Array("fnLB", 9001), Array("fnRB", 9002), Array("pOW", 9889), Array("bSIZE", 572), Array("strLEN", 10231), Array("dOM", 916), Array("mapTO", 10230), Array("sELEM", 8712), Array("sUBSET", 8838), Array("sUNION", 8746), Array("sINTERSECT", 8745), Array("fALL", 8704), Array("tEXISTS", 8707), Array("sUM", 8721), Array("pROD", 8719), Array("sOL", 167), Array("strMODL", 9665), Array("strMODR", 9655), Array("iNF", 8734), Array("sTATE", 963), Array("squigglyARROW", 8669), Array("tHEREFORE", 8756), Array("uNLIST", 9838), Array("bINTERSECT", 8216), Array("rDOT", 8901), Array("-|>", 8603), Array("->", 8594), Array("<|-", 8602), Array("<-", 8592), Array("<=", 8804), Array(">=", 8805), Array("<", 60), Array(">", 62), Array("mUNION", 1608), Array("wCOMP", 611))
  30.  
  31. For Each textSymbolPair In textSymbolPairList
  32.     someNumber = autoReplaceStringPlaceholdersWithSymbolsLoop(textSymbolPair(0), textSymbolPair(1))
  33. Next
  34.  
  35.    
  36. End Sub
Advertisement
Add Comment
Please, Sign In to add comment