示例#1
0
        //+---------------------------------------------------------------------------
        //
        //  function:    setTSID
        //
        //  Synopsis:    sets the value of TSID for a FaxDevice
        //
        //  Arguments:  [objFaxDevices] - FaxDevices object pointing to the list of devices on the server
        //				[lDeviceId] - Device Id of the device to be set
        //				[strTSID] -	value of the TSID
        //
        //  Returns:     bool: true if passed successfully
        //
        //----------------------------------------------------------------------------
        static bool setTSID(FAXCOMEXLib.IFaxDevices objFaxDevices, int iDeviceId, string strTSID)
        {
            FaxDevice objFaxDevice = null;

            if (objFaxDevices != null && String.IsNullOrEmpty(strTSID) == false)
            {
                objFaxDevice = objFaxDevices.get_ItemById(iDeviceId);
                //set TSID
                objFaxDevice.TSID = strTSID;
                //Save it
                objFaxDevice.Save();
                System.Console.WriteLine("New TSID is set");
                return(true);
            }
            System.Console.WriteLine("setTSID: Parameter is NULL");
            return(false);
        }
示例#2
0
        private void Microsoft_Click(object sender, EventArgs e)
        {
            var wordApp = new WORDCOM.Application();

            // var wordAddress= wordApp.AddAddress
            //var work_document = new WORDCOM.Document();
            wordApp.Visible = true;
            object useDefaultValue = Type.Missing;

            wordApp.Documents.Add(ref useDefaultValue, ref useDefaultValue, ref useDefaultValue, ref useDefaultValue);
            wordApp.ActivePrinter = "SHARP MX-2310F FAX";
            FaxDevice dc = new FaxDevice();
            // dc.
            // wordApp.AddAddress("Nguoi dung 1",)
            //wordApp.ActiveDocument.PrintOut(ref useDefaultValue, ref useDefaultValue, ref useDefaultValue, ref useDefaultValue, ref useDefaultValue, ref useDefaultValue, ref useDefaultValue, ref useDefaultValue, ref useDefaultValue, ref useDefaultValue, ref useDefaultValue, ref useDefaultValue, ref useDefaultValue, ref useDefaultValue, ref useDefaultValue, ref useDefaultValue, ref useDefaultValue, ref useDefaultValue);
            //wordApp.ActiveDocument.SendFax("0524859018", "Test from");
            // wordApp.ActiveDocument.SendFax("0524859018", "This is fax");
        }
示例#3
0
        //+---------------------------------------------------------------------------
        //
        //  function:    listDevices
        //
        //  Synopsis:    sets the value of TSID for a FaxDevice
        //
        //  Arguments:  [pFaxDevices] - FaxDevices object pointing to the list of devices on the server
        //
        //  Returns:     bool: true if passed successfully
        //
        //----------------------------------------------------------------------------
        static bool listDevices(IFaxDevices objFaxDevices)
        {
            FaxDevice objFaxDevice = null;
            int       count        = objFaxDevices.Count;

            if (objFaxDevices != null)
            {
                for (int i = 0; i < count; i++)
                {
                    objFaxDevice = objFaxDevices[i + 1];
                    System.Console.Write("Device No: ");
                    System.Console.Write(i);
                    System.Console.Write("  Device Id = ");
                    System.Console.Write(objFaxDevice.Id);
                    System.Console.Write("  Device Name = ");
                    System.Console.Write(objFaxDevice.DeviceName);
                    System.Console.WriteLine();
                }
                return(true);
            }
            System.Console.WriteLine("listDevices: Parameter is NULL");
            return(false);
        }