Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42215

VS 2010 [RESOLVED] Problem filling a word template from vb

$
0
0
I am filling a word template from vb and found the following example:

http://www.vbforums.com/showthread.p...late-from-.NET

My template looks like this:
<full name>
<postion>
<company>

I use the following code:

MyWord = CreateObject("Word.Application")
MyWord.Visible = True
MyWord.Documents.Open(file)
With MyWord
.ActiveDocument.Bookmarks("MIS_contact_fullname").Range.Text = "FullName"
.ActiveDocument.Bookmarks("MIS_contact_position").Range.Text = "Position"
End With

I end up with:
Position<company>

I was expecting:
FullName
Position
<company>

It appears that adding one field causes the previous field to be deleted.

I have tried adding a 'vbcrlf' but that doesn't help.

Any suggestions on what I'm doing wrong?
Thanks

Viewing all articles
Browse latest Browse all 42215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>