Unwanted Symbols

S

sturner333

I have inserted tables into a Word document that get its data from
an Access program. The only problem I have is when data from Access that was
on multiple lines is put into a cell on the document, those square carriage
return symbols show up and characters(words) are lines up one after another
with these squares separating them:

Per Nilssonâ–¡â–¡bob smith

rather than

Per Nillson
bob smith

How do I get rid of those?
Thanks for the help!
 
D

Doug Robbins - Word MVP

Select an instance of the square boxes and use Ctrl+C to copy them to the
clip board and then with the Edit>Replace dialog open, use Ctrl+V to paste
them into the Find what control and in the Replace with Control, enter ^p
and then click on Replace all.

--
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
 
D

Doug Robbins - Word MVP

How are you transferring the data from Access to Word?

--
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
 
S

sturner333

like this:
Private Sub cmdPrint_Click()
'Print customer slip for current customer.
Dim appWord As Word.Application
Dim doc As Word.Document
'Avoid error 429, when Word isn't open.
On Error Resume Next
Err.Clear
'Set appWord object variable to running instance of Word.
Set appWord = GetObject(, "Word.Application")
If Err.Number <> 0 Then
'If Word isn't open, create a new instance of Word.
Set appWord = New Word.Application
End If
Set doc = appWord.Documents.Open("C:\WordForms\CustomerSlip.doc", , True)
With doc
..FormFields("fldCustomerID").Result = Me!CustomerID
..FormFields("fldCompanyName").Result = Me!CompanyName
..FormFields("fldContactName").Result = Me!ContactName
..FormFields("fldContactTitle").Result = Me!ContactTitle
..FormFields("fldAddress").Result = Me!Address
..FormFields("fldCity").Result = Me!City
..FormFields("fldRegion").Result = Me!Region
..FormFields("fldPostalCode").Result = Me!PostalCode
..FormFields("fldCountry").Result = Me!Country
..FormFields("fldPhone").Result = Me!Phone
..FormFields("fldFax").Result = Me!Fax
..Visible = True
..Activate
End With
Set doc = Nothing
Set appWord = Nothing
Exit Sub
errHandler:
MsgBox Err.Number & ": " & Err.Description
End Sub


Thanks
 
D

Doug Robbins - Word MVP

Use the Replace function to replace the Asc(10) characters (the square
boxes) with Asc(13) (Carriage Return)

..FormFields("fldContactName").Result = Replace( Me!ContactName, Chr(10),
Chr(13))

If you have are now getting two square boxes, then you will probably need

..FormFields("fldContactName").Result = Replace( Me!ContactName,
Chr(10)Chr(10), Chr(13))


--
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
 

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