reggie55555
MIS
chr(13) (and "^p") in a VBA macro is sometimes skipped when the macro is run. The macro is intended to insert various predefined strings into a word doc.
Example:
Does anyone know why this may be happening?
Here is a sample of the desired result:
Here is an example of when the chr(13) is skipped:
Example:
Code:
istring(1) = "This is some text"
istring(2) = "This is more text that appears in a new paragraph"
Set objselection = wdAPP.Selection
With objselection
.EndKey wdStory, wdMove
.Font.Size = 10
.TypeText Chr(13) & istring(1) & Chr(13) & Chr(13) & istring(2) & Chr(13)
End With
Does anyone know why this may be happening?
Here is a sample of the desired result:
Code:
This is some text
This is more text that appears in a new paragraph
Here is an example of when the chr(13) is skipped:
Code:
This is some textThis is more text that appears in a new paragraph