Ann, if I understand you correctly, there could be other ParagraphTextElements on the layout, and you need to add your disclaimer element if it doesn't exist.The following method will do that:
public void PerformTest()
{
const string myParaTextID = "MyDisclaimerTextID";
string paraText = "Sample disclaimer paragraph text";
IGraphicsContainer graphicsContainer = ArcMap.Document.PageLayout as IGraphicsContainer;
IElement element;
IElementProperties elementProperties;
// Check if the disclaimer text element already exists in layout
graphicsContainer.Reset();
while ((element = graphicsContainer.Next()) != null)
{
if (element is IParagraphTextElement)
{
elementProperties = element as IElementProperties;
if (elementProperties.Name == myParaTextID)
{
MessageBox.Show("The Disclaimer Text, which autoupdates " +
"the time and date, is already placed in the map.");
return;
}
}
}
// No disclaimer found, so make one
IParagraphTextElement paraTextElement = new ParagraphTextElementClass();
ITextElement textElement = paraTextElement as ITextElement;
elementProperties = paraTextElement as IElementProperties;
element = paraTextElement as IElement;
// Set this so it can be found if this method called again
elementProperties.Name = myParaTextID;
// Set the actual text to display
textElement.Text = paraText;
// Set the size and location of the text box
IEnvelope envelope = new EnvelopeClass();
envelope.PutCoords(0, 0, 3, 1);
element.Geometry = envelope;
// Add the text box to the layout
graphicsContainer.AddElement(element, 0);
ArcMap.Document.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
}
Note that the "Name" property used to ID the disclaimer element is visible and editable to the user on the properties dialog for the element in ArcMap. If you want more robust tagging of elements (ie, hidden from the user), you need to attach a custom object such as a PropertySet.-Jeff