View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jakeatkins via OfficeKB.com jakeatkins via OfficeKB.com is offline
external usenet poster
 
Posts: 1
Default Macro to Print Text to file in UTF-8

Hello,

I am trying to print the value of a cell in Excel to a file "temp.html". The
button's macro looks like this:

Sub Text()
Dim i As Long
Open "c:\temp\Homepage.html" For Output As #1
For i = 1 To Selection.Cells.Count
Print #1, Selection.Cells(i).Value
Next i
Close 1
End Sub

I need to know what to add to this code so that the file is created as UTF-8
encoding. I am trying to preserve foreign characters, and currently they are
all being saved as "???????????".

Thanks!

--
Message posted via http://www.officekb.com