In a project with 1 commandbutton, place the following code: Option Explicit Private Declare Function GetPrivateProfileString Lib "kernel32" Alias _ "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal _ lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As _ String, ByVal nSize As Long, ByVal lpFileName As String) As Long Private Declare Function WritePrivateProfileString Lib "kernel32" Alias _ "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal _ lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As _ Long Private Sub Command1_Click() Dim sData As String Dim lDataLen As Long ' Read from WIN.INI ' [Desktop] ' Wallpaper={path\filename.bmp} sData = Space$(255) ' Allocate space for the string lDataLen = GetPrivateProfileString("Desktop", "Wallpaper", "", sData, _ Len(sData), "win.ini") ' strip off the NULL that API routines put on the end of strings sData = Left$(sData, lDataLen) ' Print the string to the debug window Debug.Print sData ' Now write to WIN.INI ' [Desktop] ' Test=here is some text sData = "here is some text" WritePrivateProfileString "Desktop", "Test", sData, "win.ini" End Sub