Sub Button1_Click() Dim obj As CallingCSharpFromWord97.PJKWordClass Set obj = CreateObject("CallingCSharpFromWord97.PJKWordClass") obj.WriteLogFile "MS Word" Set obj = Nothing End SubAnd the C# class
using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Runtime.InteropServices; namespace CallingCSharpFromWord97 { public class PJKWordClass { public TextWriter tw = null; public PJKWordClass() { } public void WriteLogFile(string msg) { tw = new StreamWriter("c:\\PJKCalledFromWord97.log", true); tw.WriteLine(String.Format("This file was created by C# which was called from a COM client {0} at {1}",msg,DateTime.Now.ToLongDateString())); tw.Close(); } } }The class is callable from VFP7 with no problem I think maybe it's a Office 97 issue.