#1
|
|||
|
|||
i want to add a line break after selection word 19
Sub cloze()
' ' Macro2 Macro ' Selection.InsertBefore Text:="{{c1::" Selection.InsertAfter Text:="}}" ' End Sub i want to add a line break after selection i want something like Selection.InsertAfter Text:="line break" but this adds text not an actual line break |
#2
|
||||
|
||||
Do you mean like
Code:
Sub cloze() ' ' Macro2 Macro ' Selection.InsertBefore Text:="{{c1::" Selection.InsertAfter Text:="}}" & vbCr Selection.Collapse 0 ' End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
thank you
works perfectly
|
#4
|
|||
|
|||
One last thing, how to insert a quote with InsertBefore method
InsertBefore Text:=""" How does escaping work? I tried \ and / but neither work i tried single quote as in the picture but some error occurred |
#5
|
||||
|
||||
I think what you want is
Code:
Sub Quote() Selection.InsertBefore Chr(34) Selection.InsertAfter Chr(34) & ", ," & vbCr Selection.MoveEnd 6 'the number of characters added after the selection Selection.Collapse 0 End Sub '0r Sub Quote2() Selection.InsertBefore """" Selection.InsertAfter """, ," & vbCr Selection.MoveEnd 6 'the number of characters added after the selection Selection.Collapse 0 End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#6
|
|||
|
|||
thank you. You are brilliant
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Removing line break and indentation between footnote number and footnote text in Word | jaanross | Word | 5 | 02-06-2020 12:04 AM |
Section and Line Break leaving line on previous page | Stonehands99 | Word | 5 | 08-13-2019 08:59 PM |
Word converts section break to page break before columns, does not insert column breaks | eborda | Word | 1 | 03-24-2017 11:06 PM |
Interchange line break and paragraph break shortcut keys | skan | Word | 2 | 01-20-2017 03:50 AM |
Add paragraph break to the end of each line in Microsoft Word? | vaga95 | Word | 1 | 06-24-2016 08:19 AM |