Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / May 2006

Tip: Looking for answers? Try searching our database.

Strange Print error with VBA created doc

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hals_left - 25 May 2006 13:58 GMT
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
Doug Robbins - Word MVP - 25 May 2006 16:04 GMT
Nothing to do with the code I would think, but I would use

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

Signature

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

> Hi This may or not be vba related.
>
[quoted text clipped - 36 lines]
>        ActiveDocument.Tables(2).Rows(1).Cells(1).Select
>        Selection.Text = strAddress
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.