Hi This may or not be vba related.

Has anyone ever encountered a prioblem like this before, Or know a
solution

A table cell in a word doc contains multiple address lines, created
using the code below in a template.

The address loooks just fine in Word and even in print preview, but on
the actual paper on the first line appears. Also intermittent , works
ok on some printers.
Users have found a workaround, cut the address then paste it back
before printing.
Any thoughts ?

Thanks
hals_left

Set objRS = objConn.Execute(strSQL)
If Not objRS.EOF Then

strAddress= objRS("BusinessName")
strAdd1 = objRS("Add1")
strAdd2 = objRS("Add2")
strAdd3 = objRS("Add3")
strTown = objRS("TownCity")
strCountyLine = objRS("County") & vbTab & objRS("PostCode")

If strAdd1 <> "" Then strAddress = strAddress & vbCrLf &
strAdd1
If strAdd2 <> "" Then strAddress = strAddress & vbCrLf &
strAdd2
If strAdd3 <> "" Then strAddress = strAddress & vbCrLf &
strAdd3
If strTown <> "" Then strAddress = strAddress & vbCrLf &
strTown
strAddress = strAddress & vbCrLf & strCountyLine

ActiveDocument.Tables(2).Rows(1).Cells(1).Select
Selection.Text = strAddress

Re: Strange Print error with VBA created doc by Doug

Doug
Thu May 25 10:04:30 CDT 2006

Nothing to do with the code I would think, but I would use

ActiveDocument.Tables(2).Cell(2,1).Range.Text=strAddress

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"hals_left" <cc900630@ntu.ac.uk> wrote in message
news:1148561910.399060.136130@j73g2000cwa.googlegroups.com...
> Hi This may or not be vba related.
>
> Has anyone ever encountered a prioblem like this before, Or know a
> solution
>
> A table cell in a word doc contains multiple address lines, created
> using the code below in a template.
>
> The address loooks just fine in Word and even in print preview, but on
> the actual paper on the first line appears. Also intermittent , works
> ok on some printers.
> Users have found a workaround, cut the address then paste it back
> before printing.
> Any thoughts ?
>
> Thanks
> hals_left
>
> Set objRS = objConn.Execute(strSQL)
> If Not objRS.EOF Then
>
> strAddress= objRS("BusinessName")
> strAdd1 = objRS("Add1")
> strAdd2 = objRS("Add2")
> strAdd3 = objRS("Add3")
> strTown = objRS("TownCity")
> strCountyLine = objRS("County") & vbTab & objRS("PostCode")
>
> If strAdd1 <> "" Then strAddress = strAddress & vbCrLf &
> strAdd1
> If strAdd2 <> "" Then strAddress = strAddress & vbCrLf &
> strAdd2
> If strAdd3 <> "" Then strAddress = strAddress & vbCrLf &
> strAdd3
> If strTown <> "" Then strAddress = strAddress & vbCrLf &
> strTown
> strAddress = strAddress & vbCrLf & strCountyLine
>
> ActiveDocument.Tables(2).Rows(1).Cells(1).Select
> Selection.Text = strAddress
>