Strange Print Error With VBA Created Doc - Solution

C

cc900630

The solution was in the Word Application itself.
Tools->Options->Print->Hidden Text. Selecting this option fixed it.

Seems on some machines, Word treats vba created text in text boxes as
hidden by default.

hals_left


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top