1

This simple macro will write the text "ABC" to the file temp.txt under E: drive. However if we open the text file, notice that there is a new line char after C. How can we get rid of this, so that it will end after C

Code:

Sub ExamplePrint
i = FreeFile()
Open "e:\Temp.txt" For Output As i
Print #i, "ABC"
Close #i
end Sub 

In vba if we give like this, the newline doesnt come. however in openoffice the whole text document comes as empty

Code:

Print #i, "ABC"; 
4

1 回答 1

1

试试 FileSystemObject:

http://msdn.microsoft.com/en-us/library/6ee7s9w2%28v=vs.85%29.aspx

于 2012-05-12T12:27:45.653 回答