I'm not sure why we're gravedigging this old thread or answering VBA macro plinking questions in the VB programming forum, but...
If you install CAPICOM it becomes a trivial matter.
Despite the dire warnings they use to try to make you use .Net CAPICOM works fine.
Code:Option Explicit Private CAPIUtilities As New CAPICOM.Utilities Private Sub Command1_Click() 'Convert payload to ANSI, then Base64 encode that: Text2.Text = CAPIUtilities.Base64Encode(StrConv(Text1.Text, vbFromUnicode)) End Sub Private Sub Command2_Click() 'Decode Base64, convert payload back to Unicode: Text3.Text = StrConv(CAPIUtilities.Base64Decode(Text2.Text), vbUnicode) End Sub




Reply With Quote