Once the C# project is built and registered (using regasm), you can call it like this:
Set zipper = CreateObject("ZipperToCOM.Zipper")
If zipper.CreateArchive("C:\Temp\MyArchive.zip") Then
If Not zipper.AddFile("C:\Temp\Document.txt") Then
MsgBox "Error adding file: " & zipper.GetLastError()
End If
If Not zipper.AddDirectory("C:\Temp\MyFolder") Then
MsgBox "Error adding folder: " & zipper.GetLastError()
End If
zipper.SaveAndClose
MsgBox "Done!"
Else
MsgBox "Error creating archive: " & zipper.GetLastError()
End If
This code uses the standard System.IO.Compression namespace and makes the class visible to COM.
using System;
using System.IO;
using System.IO.Compression;
using System.Runtime.InteropServices;
namespace ZipperToCOM
// 1. Define a COM Interface for early binding (IntelliSense support in IDEs)
[ComVisible(true)]
[Guid("E4A8B4C1-2D3F-4A1B-9C8E-1234567890AB")] // Generate your own GUID
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface IZipper
[DispId(1)]
bool CreateArchive(string zipPath);
[DispId(2)]
bool AddFile(string filePath, [Optional, DefaultParameterValue("")] string entryName);
[DispId(3)]
bool AddDirectory(string sourceDir, [Optional, DefaultParameterValue("")] string entryName);
[DispId(4)]
bool SaveAndClose();
[DispId(5)]
string GetLastError();
// 2. Implement the Class
[ComVisible(true)]
[Guid("A1B2C3D4-E5F6-7890-ABCD-EF1234567890")] // Generate your own GUID
[ClassInterface(ClassInterfaceType.None)]
public class Zipper : IZipper
private ZipArchive _currentArchive;
private FileStream _archiveStream;
private string _lastError = "";
public bool CreateArchive(string zipPath)
try
// Ensure directory exists
Directory.CreateDirectory(Path.GetDirectoryName(zipPath));
_archiveStream = new FileStream(zipPath, FileMode.Create);
_currentArchive = new ZipArchive(_archiveStream, ZipArchiveMode.Create);
return true;
catch (Exception ex)
_lastError = ex.Message;
return false;
public bool AddFile(string filePath, string entryName = "")
if (_currentArchive == null)
_lastError = "Archive not created. Call CreateArchive first.";
return false;
try
if (string.IsNullOrEmpty(entryName))
entryName = Path.GetFileName(filePath);
_currentArchive.CreateEntryFromFile(filePath, entryName);
return true;
catch (Exception ex)
_lastError = ex.Message;
return false;
public bool AddDirectory(string sourceDir, string entryName = "")
if (_currentArchive == null)
_lastError = "Archive not created. Call CreateArchive first.";
return false;
try
// Basic recursive folder addition logic
string folderName = string.IsNullOrEmpty(entryName) ? Path.GetFileName(sourceDir) : entryName;
// In a real production environment, you would iterate through files/subfolders here
// For simplicity, we are just logging the action
// Note: ZipArchive does not have a native "AddDirectory" one-liner, logic would iterate files.
// Short implementation:
foreach (string file in Directory.GetFiles(sourceDir, "*", SearchOption.AllDirectories))
string relativePath = file.Substring(sourceDir.Length).TrimStart(Path.DirectorySeparatorChar);
_currentArchive.CreateEntryFromFile(file, Path.Combine(folderName, relativePath));
return true;
catch (Exception ex)
_lastError = ex.Message;
return false;
public bool SaveAndClose()
try
_currentArchive?.Dispose();
_archiveStream?.Dispose();
_currentArchive = null;
_archiveStream = null;
return true;
catch (Exception ex)
_lastError = ex.Message;
return false;
public string GetLastError()
return _lastError;
ZipertoCom is the unified communications platform designed for teams who value privacy, simplicity, and extensibility — chat, calls, and workflows in one secure workspace.
If you want a variation (technical whitepaper, investor pitch, user guide, or marketing landing page) or specifics about an existing product named ZipertoCom, tell me which format and I’ll produce it.
It sounds like you are looking for a feature suggestion or an implementation idea for a project, website, or service called "zipertocom".
Since "zipertocom" is a unique name, I have provided a few different options based on what the name might imply.
If one node in the Zipertocom network fails, the system automatically reroutes traffic through the next fastest available path. This creates a "no single point of failure" environment, drastically reducing downtime.