Applies To:
  • CitectSCADA v6.x, v7.x
  • VijeoCitect v6.x, v7.x 

Summary:
ciText.TextBox is an ActiveX control supplied by CitectSCADA/VijeoCitect. It functionality is not limited to displaying text that is binded on a variable tag. It has an extended functionality to load and save a specific RTF file to achieve simple text formatting if needed. We can achieve this functionality through some simple cicode function.

Solution:
We can use the method specified in the ActiveX control that are named "SaveFile" and "LoadFile" respectively. An example on a custom cicode function to load and save file is as follows:

------------------------------------------------------
FUNCTION SaveFile()
OBJECT oTextBox;
oTextBox = ObjectByName("AN207");
_ObjectCallMethod(oTextBox, "SaveFile", "C:\Documents and Settings\Administrator\Desktop\test.rtf");
END

FUNCTION LoadFile()
OBJECT oTextBox;
oTextBox = ObjectByName("AN207");
_ObjectCallMethod(oTextBox, "LoadFile", "C:\Documents and Settings\Administrator\Desktop\test.rtf");
END
-------------------------------------------------------

Please note that ObjectByName() function takes in the 'AN' number of the ciText.TexBox ActiveX control. Therefore, you will need to check the AN number of the TextBox that you used on the page.

Also, the _ObjectCallMethod() function takes in 3 arguments:
1st argument = The object handle
2nd argument = the method from the activeX control
3rd argument = the path to the rtf file. In this case, the test.rtf is located on the desktop. Use any valid path.

Keywords:
 rtf, ciText, textbox, activeX, object, load file, save file

Attachments