Results 1 to 7 of 7

Thread: [HELP] Base64 (VBA) simple function

Threaded View

  1. #7
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: [HELP] Base64 (VBA) simple function

    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
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width