I can get it to work with integers, but when I try coding my program to save a string, it doesn't seem to work. I think I am just formatting the code incorrectly.
Here is my code in my module:
And here is my code in the form:Code:Declare Function WritePrivateProfileString Lib "kernel32" _ Alias "WritePrivateProfileStringA" _ (ByVal sSectionName As String, _ ByVal sKeyName As String, _ ByVal sString As String, _ ByVal sFileName As String) As Long Declare Function GetPrivateProfileString Lib "kernel32" _ Alias "GetPrivateProfileStringA" _ (ByVal sSectionName As String, _ ByVal sKeyName As String, _ ByVal lDefault As Long, _ ByVal sFileName As String) As Long
This code is simplified to make it simpler, but there is something wrong with that last line. How do I get it to save txtSave.Text in the Prefs.ini?Code:Option Explicit Public strFile As String Private Sub cmdsave_Click() strFile = App.Path & "\Prefs.ini" WritePrivateProfileString = ("Section","TextBox1",txtSave.Text,strFile) End Sub
Also, how would I load it into another text box or string or something?
Thanks in advance




Reply With Quote