473,748 Members | 2,223 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Carriage Return problems when importing from a Word document

I am trying to import data from a Word document into an Access table
with VBA.

The Word document is a form which has various fields. One of the fields
is a field for notes. In some cases, this note field contains carriage
returns.

When I import a note field that has carriage returns, what shows up in
the Access field are vertical black lines where the carriage return
should be.

I have done searches on this problem, and seen a number of "solutions" ,
one from Microsoft suggests turning the carriage returns into tabs,
another solution simply eliminates the carriage returns altogether.

I have tried using the instr() function to identify where the carriage
returns are in the field, then replacing them with vbCr and VbLf to
place them in the field, but it still puts the black bar in their
place. I know from my reading that Access interprets the carriage
returns as delimiters, but does anyone know a way to import a field
with carriage returns in it without getting the black lines and
actually showing the line breaks?

Thanks

Nov 13 '05 #1
2 2951
You can fix this problem in 2 steps. In the first step you import your
text and parse out the carriage returns with the Instr() function. You
need to record the values where the carriage returns occurred. Now
store your text as one string in a table. Then recreate the string
(step 2) and apply vbcrlf per the values you recorded in step 1. Write
this new string to its intended destination. This may seem tedious, but
if you want a programmatic solution, this is one solution.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #2
Thanks Rich, using the vbcrlf in place of the carriage returns does the
trick. I appreciate your help.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
24745
by: Pia | last post by:
Please help! I'm trying to get my xsl to produce 0x0D, not just 0x0A. Any ideas on how to do this? Right now, if I try the following, my output only shows 0x0a: <xsl:variable name="cr" select="'&#xD;'"/> <xsl:value-of select="$cr"/> Thank you! Pia
4
9881
by: Dr. Laurence Leff | last post by:
I am writing a Java program to read in XML file, modify some elements slightly, and then write it out. That XML file is prepared in Docbook. It works fine, except that it is disturbing the carriage returns in places where they have meaning. Attached are a sample input file, the sample output file, and a simplified version of my Java program. My real file, examines certain element's attributes and adds certain elements to the DOM...
1
1800
by: Porthos | last post by:
Hello all, Is there a facet pattern that will allow for the inclusion of a newline or carriage return to occur within a tag? From the W3C schema document and from previous posts I've read that should take care of this situation, however when I include that pattern (and a newline\carriage return) I still recieve an error telling me that my data is an invalid value according to its data type. When I remove the returns and new lines the...
3
4457
by: Doug | last post by:
How do I add a carriage return in a Word Document using C#? When I try the \r\n it doesn't work, it prints the character that represents a carriage return, but doesn't actually do a carriage return.
1
6260
by: Blue | last post by:
This JS limits the input characters into the form. How do I modify it so that it also allows CARRIAGE RETURN and BACKSPACE (for making text correction)? Due to the template engine I am using, I cannot use IF/ELSE statement. ============================== <form> <textarea name="event_description" ONKEYPRESS="if (document.layers)
4
27829
by: whitej77777 | last post by:
I am trying to write a user defined function that will allow me to strip off the last carriage return and line feed from a text field. We have address fields stored in a text field for our ERP system and some of them have an extra carriage return and line feed at the end of them. This causes havoc when we sync between our ERP system and CRM system. If anyone knows a way to solve this problem the help would be appreciated. Examples:...
1
1986
by: =?Utf-8?B?Sm9XaWxsbW90dA==?= | last post by:
I have data that I would like to store in an excel spreadsheet. It's currently in a Word table. The problem is that each line has some cells that split over several lines. If I copy and paste it as is, the data split over lines get put into separate rows. I have partly solved this problem by replacing the paragraph mark (^p) in Word with a tilde (~). Now the rows are as I want them. But I want to replace the tilde in Excel 2008 with a...
3
1326
by: zo62 | last post by:
I am building an XML document thru code then saving it on my local machine as well as posting it the an FTP site. When opening the XML document in my local machine. the Document is well indented and formated and has carriage return. When opening it in the FTP Site the XML document is NOT indented and the nodes are wriiten all on one line and wraped around. How can I maintain the same format (indented and line braks) when uploading the XML...
0
9528
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9359
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9310
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9236
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8235
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6792
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3298
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.