PDA

View Full Version : Sleeper: Save notepad in UTF-8 encoding



dhananjay
12-16-2008, 12:21 AM
Hi friends!!!

I am literally :banghead: to get this!!!

How to open edit and save a notpad in UTF-8 encoding using vba!!

Mahahaava
12-16-2008, 05:07 AM
Hi,

used the MAcro-recorder: UTF-8 is the BOLD-line in the following:
(this works for opening but as for saving... Dunno)


Sub Macro2()
'Macro2 Macro
' Macro recorded 16.12.2008 by Patu
With ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\layers.txt", _
Destination:=Range("A1"))
.Name = "layers"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = -535
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub

/Petri