473,394 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How do you drop the " from write#1?

I have to load a string of text into a text file and then open the file in notepad. Here's my code:
Expand|Select|Wrap|Line Numbers
  1. newTxt = "C:\PathTo\newTxt.txt"
  2. Open newTxt For Output As #1
  3. Write #1, stringOfText_variable
  4. Close #1
FollowHyperlink newTxt

Everything works fine accept one thing. Quotes are appearing before and after the text and I can't seem to get rid of them. The finished text file always looks like this..

"
line one of text
line two of text
line three of text
"

It looks like these quotes are coming from the Write #1 statement. I've tried using MID function to lop them off before the Write #1 statement, but it didn't work... it lopped off the first and last character of text, but left the quotes.

Does anyone know how to get rid of those quotes?

thanks
Adam
Sep 4 '08 #1
6 1361
missinglinq
3,532 Expert 2GB
Yes, Adam, it is coming from the Write statement. This is the normal behavior when you write to a text file from VBA, like the carriage return/linefeed you've already had problems with. Programs retrieving/using the data have to have some way to tell where one piece of data ends and the next piece begins. I'm not aware of anything you can do to deal with the problem before writing to the file. My guess would be that you'll have to deal with it on the other end, when you're retrieving the data.

Linq ;0)>
Sep 4 '08 #2
Megalog
378 Expert 256MB
Use Print #1 instead of Write #1 and you'll get no quotes.
Sep 4 '08 #3
missinglinq
3,532 Expert 2GB
Good going,Megalog! I remembered that from the old Basic days (when Basic wasn't visible) and tried to amend my post, but the site is apparently experiencing access (access with no capital "A") problems again!

Linq ;0)>
Sep 4 '08 #4
Thank you both. It worked like a charm.
Adam
Sep 4 '08 #5
Megalog
378 Expert 256MB
Glad to help. Little differences like that can be real frustrating sometimes.
Sep 4 '08 #6
NeoPa
32,556 Expert Mod 16PB
If you look up Print # in the Access Help system you'll find a bunch about that and related ways of direct input / output (See also).

As Linq says, this is pure Basic and not related to the applications at all (works across all office applications).

Welcome to Bytes Adam :)
Sep 5 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Risen | last post by:
Hi,all, I want to execute SQL command " DROP DATABASE mydb" and "Restore DATABASE ....." in vb.net 2003. But it always shows error. If any body can tell me how to execute sql command as above?...
2
by: Robert Zahm | last post by:
I have created a C# user control which display certain filesystem information, and allows the user to drag an drop files into and out of the control. I then placed this user form in IE using an...
3
by: Challenge | last post by:
Hi, I have a table creation script that generated by ERWin. An index name is too long and has been truncated as "XPKsp_prj_stk_ord_". Now I want to drop and recreate it as another name. I got...
5
by: mr_cross | last post by:
Hi. It's been a very long time since I did any extensive html coding, so all I recall are the basics. I'm looking to create a web site with a lot of jpg pictures divided among several web pages. Is...
0
by: Truevision .Net | last post by:
Hi, I have a problem with drag and drop functionality when it comes to dropping pictures from sources like for example internet explorer and the webbrowser control. Dragging and dropping from...
2
by: Codetastic | last post by:
The verbose thread title explains it. Basically, I have a toolbar that hooks file-drop events into text areas, and I'd like to perform this procedure without manually dragging. I'd like to...
0
by: Sebastian | last post by:
Hello! I work with ASP.NET Futures and I would like to realize a "Drag & Drop" - functionality on my Page. I have three "draggable Div's" and three "DropZones", but how can I get the "ID" from...
2
by: Doug | last post by:
Hi, I can't figure out how to create a drop-down list box. The help file says it exists. The icon in the help file matches the combobox in the toolbox. I tried using a combox box, both with and...
0
by: yosri2005 | last post by:
Hello, I'm sure many of you have seen the error message in the subject. I found quiet a few posts on the web regarding this issue, but the ones I saw mainly tackle this issue when you have a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...

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.