ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Line Broken Transfering data to Word (https://www.excelbanter.com/excel-programming/308400-line-broken-transfering-data-word.html)

mhferreira[_2_]

Line Broken Transfering data to Word
 
Hi, Im transfering data from excel to MS Word via code.

But i dont know how insert a line broken in a string.


Example:
X="asdf"
Y="zcxv"

wdApp.Selection.GoTo What:=wdGoToBookmark, Name:="A"
wdApp.Selection.TypeText Text:=X &\n& Y

i try use \n but donīt wor

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

Line Broken Transfering data to Word
 
Try

wdApp.Selection.TypeText Text:=X & vbNewLine & Y

--
Regards,
Tom Ogilvy


"mhferreira " wrote in message
...
Hi, Im transfering data from excel to MS Word via code.

But i dont know how insert a line broken in a string.


Example:
X="asdf"
Y="zcxv"

wdApp.Selection.GoTo What:=wdGoToBookmark, Name:="A"
wdApp.Selection.TypeText Text:=X &\n& Y

i try use \n but donīt work


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 03:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com