powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Microsoft Office [игнор отключен] [закрыт для гостей] / (WORD) Вставить неразрывный пробел?
7 сообщений из 7, страница 1 из 1
(WORD) Вставить неразрывный пробел?
    #33383744
Leon.
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Word 2002.
Формирую документ Word средствами VBA. В т.ч. подготавливаю строку суммы, используя такой вызов Format(curSum, "## ##0.00"), для получения строки типа "57 811,50". Иногда получается так, что Word переносит на следующую строку текст как раз по полученному пробелу в сумме.
Вопрос: как можно средствами VBA добавить в строку "неразрывный пробел"?
...
Рейтинг: 0 / 0
(WORD) Вставить неразрывный пробел?
    #33383828
Letter_D
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Shift + Ctrl + Пробел.
...
Рейтинг: 0 / 0
(WORD) Вставить неразрывный пробел?
    #33383839
Попробуй.

Код: plaintext
1.
2.
3.
    With Selection.Find
        .Text = " "
        .Replacement.Text = "^s"
    End With
...
Рейтинг: 0 / 0
(WORD) Вставить неразрывный пробел?
    #33383863
И Find.Execute потом.
...
Рейтинг: 0 / 0
(WORD) Вставить неразрывный пробел?
    #33384140
Leon.
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
2Пользователь2: Спасибо!
...
Рейтинг: 0 / 0
(WORD) Вставить неразрывный пробел?
    #33911724
Фотография Ivan33
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
возникла проблем, как из выделенного фрагмента удалить лишние пробелы в ворде?
...
Рейтинг: 0 / 0
(WORD) Вставить неразрывный пробел?
    #33922971
Фотография Ivan33
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Ivan33возникла проблем, как из выделенного фрагмента удалить лишние пробелы в ворде? может кому пригодиться

Consistent SpacingSearch for answers:

Advanced Search
WordTips Home > Formatting > Consistent Spacing
Consistent Spacing

авторSummary: Do you need to check your document to make sure that each sentence has
one and only one trailing space? This tip presents a macro that will make short
work of getting rid of any extraneous spaces after sentences. (This tip works
with Microsoft Word 97, Word 2000, Word 2002, and Word 2003.)
There is an unwritten rule in typesetting that there should only be one space
after the end of a sentence. This provides the best visual appearance on a
printed page, particularly when using proportional typefaces. The problem is
that it is easy to add additional spaces at the end of a sentence without even
realizing it. The following VBA macro, CheckSpaces, is a tool you can use to
double-check the end of your sentences:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
Sub CheckSpaces()
    Call MakeChanges("Normal", ".")
    Call MakeChanges("Normal", "!")
    Call MakeChanges("Normal", ":")
End Sub
Sub MakeChanges(StyName As String, PuncMark As String)
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Style = ActiveDocument.Styles(StyName)
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = PuncMark & "   "
        .Replacement.Text = PuncMark & " "
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Find.Text = PuncMark & "  "
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub
авторCheckSpaces will only take extra spaces out of paragraphs formatted with the
Normal style. This ensures you won't mess up formatting in tables or other
design elements where you may want extra spaces after periods. If you want to
change the type of punctuation searched for, or search in different style
paragraphs, add additional calls to MakeChanges after the fourth line in the
macro.
...
Рейтинг: 0 / 0
7 сообщений из 7, страница 1 из 1
Форумы / Microsoft Office [игнор отключен] [закрыт для гостей] / (WORD) Вставить неразрывный пробел?
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]