Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

xanburzum

Dividir Palavras Longas

Recommended Posts

' "­" (exibirá um hífen quando e onde ocorre uma ruptura)

' "​" *Recomendado (zero Um espaço com largura que só coloca uma pausa quando uma palavra precisa)

' " " (Um espaço regular, que será inserido em todas as vezes o seu limite)

 

'intLimit é a quantidade de caracteres para saltar antes de colocar em strBreak

 

'strInput a entrada para pesquisa

 

'EX: strMyWord = BreakWord("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX

YZabcdefghijklmnopqrstuvwxyz", 26, "­")

 

Function BreakWord(strInput, intLimit, strBreak)

Dim arWord, w, x, toSplit, toStart, strCurrentSplit, intLimitastSplit, strTemp

'espaço de definição

Dim s : s = " " 'Space(1)

 

'se nada a verificar

If strInput = "" Then Exit Function

 

'Comprimento de entrada é menor, então o nosso limite, retorna o valor atual e sai

If len(strInput) < intLimit Then

BreakWord = strInput

Exit Function

End If

 

'Pega todos os tipos de espaços para romper com as palavras

strTemp = Replace(strInput, vbTab, s)

strTemp = Replace(strTemp, vbCr, s)

strTemp = Replace(strTemp, vbLf, s)

strTemp = Replace(strTemp, " ", s)

strTemp = Trim(strTemp)

Do While InStr(1, strTemp, " ", 1) <> 0

strTemp = Replace(strTemp, " ", s)

Loop

 

'Split na entrada em um único array divididos por espaços

arWord = Split(strTemp, " ")

 

'Loop através de cada palavra

For w = 0 to Ubound(arWord)

 

 

strCurrentSplit = ""

 

'A palavra atinge ou excede o nosso limite

If len(arWord(w)) > intLimit Then

toSplit = cInt(len(arWord(w)) / intLimit)

 

For x = 1 to toSplit

If x = 1 then

toStart = 1

Else

toStart = intLimitastSplit + 1

End If

strCurrentSplit = strCurrentSplit & mid(arWord(w),toStart, intLimit) & strBreak

intLimitastSplit = cInt(intLimit*x)

If x = toSplit Then strCurrentSplit = strCurrentSplit & mid(arWord(w),intLimitastSplit+1)

Next

arWord(w) = strCurrentSplit

End If

Next

BreakWord = Join(arWord)

End Function

Compartilhar este post


Link para o post
Compartilhar em outros sites

para ter uma palavra tão grande assim a ponto de quebrar é meio complicado, fazer layout baseado nisso, mais fica o script, bom!!!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Atualização da função, que agora vai substituir entidade HTML com os valores entidade HTML antes de analisar. dividindo palavras longas nas suas entradas com base em definir o limite e você insere o valor que você definir. Exemplos no trecho.

 

‘strBreak valores podem ser

' "­" (hífen, que exibirá um hífen quando e onde ocorre uma pausa)

' "​" * Recomendado (zero, Um espaço com largura que só coloca uma pausa quando uma palavra precisa)

 

‘INTL é a quantidade de caracteres para saltar antes de colocar em strBreak

‘strInput a entrada a pesquisa

 

'EX: strMyWord = BreakWord("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW

XYZabcdefghijklmnopqrstuvwxyz", 26, "­")

 

Private Function decodeString(ByVal strInputEntry)
	strInputEntry = Replace(strInputEntry, "a", "a", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "b", "b", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "c", "c", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "d", "d", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "e", "e", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "f", "f", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "g", "g", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "h", "h", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "i", "i", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "j", "j", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "k", "k", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "l", "l", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "m", "m", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "n", "n", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "o", "o", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "p", "p", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "q", "q", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "r", "r", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "s", "s", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "t", "t", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "u", "u", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "v", "v", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "w", "w", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "x", "x", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "y", "y", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "z", "z", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "A", "A", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "B", "B", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "C", "C", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "D", "D", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "E", "E", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "F", "F", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "G", "G", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "H", "H", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "I", "I", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "J", "J", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "K", "K", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "L", "L", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "M", "M", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "N", "N", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "O", "O", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "P", "P", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "Q", "Q", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "R", "R", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "S", "S", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "T", "T", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "U", "U", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "V", "V", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "W", "W", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "X", "X", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "Y", "Y", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "Z", "Z", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "0", "0", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "1", "1", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "2", "2", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "3", "3", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "4", "4", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "5", "5", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "6", "6", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "7", "7", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "8", "8", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "9", "9", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "=", "=", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "<", "<", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, ">", ">", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "&", "&", 1, -1, 0)
	strInputEntry = Replace(strInputEntry, "", "'", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "	", " ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "
", " ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "
", " ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, " ", " ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "!", "!", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, """, """", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "#", "#", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "$", "$", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "%", "%", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "&", "&", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "'", "'", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "(", "(", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, ")", ")", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "*", "*", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "+", "+", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, ",", ",", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "-", "-", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, ".", ".", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "/", "/", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "0", "0", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "1", "1", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "2", "2", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "3", "3", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "4", "4", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "5", "5", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "6", "6", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "7", "7", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "8", "8", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "9", "9", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, ":", ":", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, ";", ";", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "<", "<", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "=", "=", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, ">", ">", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "?", "?", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "@", "@", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "A", "A", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "B", "B", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "C", "C", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "D", "D", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "E", "E", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "F", "F", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "G", "G", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "H", "H", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "I", "I", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "J", "J", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "K", "K", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "L", "L", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "M", "M", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "N", "N", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "O", "O", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "P", "P", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Q", "Q", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "R", "R", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "S", "S", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "T", "T", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "U", "U", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "V", "V", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "W", "W", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "X", "X", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Y", "Y", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Z", "Z", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "[", "[", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "\", "\", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "]", "]", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "^", "^", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "_", "_", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "`", "`", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "a", "a", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "b", "b", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "c", "c", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "d", "d", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "e", "e", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "f", "f", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "g", "g", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "h", "h", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "i", "i", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "j", "j", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "k", "k", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "l", "l", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "m", "m", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "n", "n", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "o", "o", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "p", "p", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "q", "q", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "r", "r", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "s", "s", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "t", "t", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "u", "u", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "v", "v", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "w", "w", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "x", "x", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "y", "y", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "z", "z", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "{", "{", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "|", "|", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "}", "}", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "~", "~", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "€", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "‚", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "ƒ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "„", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "…", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "†", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "‡", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "ˆ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "‰", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "Š", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "‹", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "Œ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "Ž", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "‘", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "’", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "“", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "”", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "•", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "–", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "—", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "˜", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "(tm)", "™", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "š", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "›", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "œ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "ž", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "", "Ÿ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, " ", " ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "¡", "¡", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "¢", "¢", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "£", "£", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "¤", "¤", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "¥", "¥", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "¦", "¦", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "§", "§", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "¨", "¨", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "©", "©", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ª", "ª", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "«", "«", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "¬", "¬", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "­", "­", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "®", "®", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "¯", "¯", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "°", "°", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "±", "±", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "²", "²", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "³", "³", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "´", "´", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "µ", "µ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "¶", "¶", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "·", "•", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "¸", "¸", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "¹", "¹", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "º", "º", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "»", "»", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "¼", "¼", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "½", "½", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "¾", "¾", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "¿", "¿", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "À", "À", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Á", "Á", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Â", "Â", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ã", "Ã", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ä", "Ä", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Å", "Å", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Æ", "Æ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ç", "Ç", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "È", "È", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "É", "É", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ê", "Ê", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ë", "Ë", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ì", "Ì", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Í", "Í", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Î", "Î", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ï", "Ï", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ð", "Ð", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ñ", "Ñ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ò", "Ò", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ó", "Ó", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ô", "Ô", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Õ", "Õ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ö", "Ö", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "×", "×", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ø", "Ø", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ù", "Ù", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ú", "Ú", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Û", "Û", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ü", "Ü", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ý", "Ý", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Þ", "Þ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ß", "ß", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "à", "à", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "á", "á", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "â", "â", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ã", "ã", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ä", "ä", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "å", "å", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "æ", "æ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ç", "ç", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "è", "è", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "é", "é", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ê", "ê", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ë", "ë", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ì", "ì", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "í", "í", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "î", "î", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ï", "ï", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ð", "ð", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ñ", "ñ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ò", "ò", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ó", "ó", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ô", "ô", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "õ", "õ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ö", "ö", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "÷", "÷", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ø", "ø", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ù", "ù", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ú", "ú", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "û", "û", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ü", "ü", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ý", "ý", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "þ", "þ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ÿ", "ÿ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Œ", "Œ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "œ", "œ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Š", "Š", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "š", "š", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ÿ", "Ÿ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "Ž", "Ž", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ž", "ž", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ƒ", "ƒ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "ˆ", "ˆ", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "˜", "˜", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "–", "–", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "—", "—", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "‘", "‘", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "’", "’", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "‚", "‚", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "“", "“", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "”", "”", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "„", "„", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "†", "†", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "‡", "‡", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "•", "•", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "…", "…", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "‰", "‰", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "‹", "‹", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "›", "›", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "€", "€", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "№", "№", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "™", "™", 1, -1, 1)
	decodeString = strInputEntry
End Function

Function BreakWord(strInput, intL, strBreak)
	Dim arWord, w, x, toSplit, toStart, strCurrentSplit, intlastSplit, strTemp
	Dim s : s = Space(1)
	If strInput = "" Then Exit Function
	If len(strInput) < intL Then
		BreakWord = strInput
		Exit Function
	End If
	strInput = decodeString(strInput)
	strTemp = Replace(strInput, vbTab, s)
	strTemp = Replace(strTemp, vbCr, s)
	strTemp = Replace(strTemp, vbLf, s)
	strTemp = Replace(strTemp, " ", s)
	strTemp = Trim(strTemp)
	Do While InStr(1, strTemp, "  ", 1) <> 0
		strTemp = Replace(strTemp, "  ", s)
	Loop
	arWord = Split(strTemp, " ")
	For w = 0 to Ubound(arWord)
		strCurrentSplit = ""
		If len(arWord(w)) > intL Then
			toSplit = cInt(len(arWord(w)) / intL)
			For x = 1 to toSplit
				If x = 1 then 
					toStart = 1
				Else
					toStart = intlastSplit + 1
				End If
				strCurrentSplit = strCurrentSplit & mid(arWord(w),toStart, intL) & strBreak
				intlastSplit = cInt(intL*x)
				If x = toSplit Then strCurrentSplit = strCurrentSplit & mid(arWord(w),intlastSplit+1)
			Next
			arWord(w) = strCurrentSplit
		End If
	Next
	BreakWord = Join(arWord)
End Function

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.