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

Код: plaintext
1.
2.
3.
    With Selection.Find
        .Text = " "
        .Replacement.Text = "^s"
    End With
...
Рейтинг: 0 / 0
17.11.2005, 12:53:10
    #33383863
(WORD) Вставить неразрывный пробел?
И Find.Execute потом.
...
Рейтинг: 0 / 0
17.11.2005, 14:09:34
    #33384140
Leon.
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
(WORD) Вставить неразрывный пробел?
2Пользователь2: Спасибо!
...
Рейтинг: 0 / 0
10.08.2006, 21:53:53
    #33911724
Ivan33
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
(WORD) Вставить неразрывный пробел?
возникла проблем, как из выделенного фрагмента удалить лишние пробелы в ворде?
...
Рейтинг: 0 / 0
16.08.2006, 18:22:10
    #33922971
Ivan33
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
(WORD) Вставить неразрывный пробел?
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
Форумы / Microsoft Office [игнор отключен] [закрыт для гостей] / (WORD) Вставить неразрывный пробел? / 7 сообщений из 7, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


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