<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>System Variable in Annotation</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left>
<DIV dir=ltr align=left><SPAN class=546290617-28022006><FONT face=Arial
color=#0000ff size=2>John,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=546290617-28022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=546290617-28022006><FONT face=Arial
color=#0000ff size=2>Try adding the following VBA code to your map. You will
have to modify it to suit your needs. You can email me if you have any
questions.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=546290617-28022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=546290617-28022006><!-- Converted from text/plain format -->
<P><FONT size=2>Gregory Ross<BR>Senior Laboratory Technician<BR>University of
Florida / IFAS<BR>Florida Medical Entomology Laboratory<BR>200 9th Street
SE<BR>Vero Beach, FL 32962<BR>772-778-7200 ext <SPAN
class=546290617-28022006>152</SPAN><BR></FONT><A
href="http://mosquito.ifas.ufl.edu/"><FONT
size=2>http://mosquito.ifas.ufl.edu/</FONT></A><BR><A
href="http://fmel.ifas.ufl.edu/index.htm"><FONT
size=2>http://fmel.ifas.ufl.edu/index.htm</FONT></A> </P></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=546290617-28022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=546290617-28022006><FONT face=Arial
color=#0000ff size=2>Dim pMxDoc As IMxDocument<BR>Dim pGraphicsContainer As
IGraphicsContainer<BR>Dim pPageLayout As IPageLayout<BR>Dim pEnumElement As
IEnumElement<BR>Dim pTextElement As ITextElement<BR>Dim pElement As
IElement</FONT></SPAN></DIV>
<DIV> </DIV><SPAN class=546290617-28022006><FONT face=Arial color=#0000ff
size=2>
<DIV dir=ltr align=left><BR>Private Function MxDocument_OpenDocument() As
Boolean</DIV>
<DIV> </DIV>
<DIV dir=ltr align=left>Set pMxDoc = ThisDocument<BR>Set pPageLayout =
pMxDoc.PageLayout<BR>Set pGraphicsContainer = pPageLayout</DIV>
<DIV> </DIV>
<DIV dir=ltr align=left>Dim pPoint As IPoint<BR>Set pPoint = New Point</DIV>
<DIV> </DIV>
<DIV dir=ltr align=left>'enter the x and y values of your text element
here<BR>pPoint.x = 2<BR>pPoint.y = 2<BR>'</DIV>
<DIV> </DIV>
<DIV dir=ltr align=left>Set pEnumElement =
pGraphicsContainer.LocateElements(pPoint, 0.5)</DIV>
<DIV> </DIV>
<DIV dir=ltr align=left>pEnumElement.Reset<BR>Set pElement =
pEnumElement.Next<BR>If TypeOf pElement Is ITextElement
Then<BR> pGraphicsContainer.DeleteElement
pElement<BR> Call
Project.AddDate.AddText<BR> Exit Function<BR>End If</DIV>
<DIV> </DIV>
<DIV dir=ltr align=left>Dim m_pMxDoc As IMxDocument<BR>Dim m_pPageLayout As
PageLayout<BR>Dim m_pGContainer As IGraphicsContainer</DIV>
<DIV> </DIV>
<DIV dir=ltr align=left>Public Sub AddElement(AnElement As IElement,
PagePosition As IGeometry)<BR>Set m_pMxDoc = ThisDocument<BR>Set m_pPageLayout =
m_pMxDoc.PageLayout<BR>AnElement.Geometry = PagePosition<BR>Set m_pGContainer =
m_pPageLayout<BR>m_pGContainer.AddElement AnElement,
0<BR>m_pMxDoc.ActiveView.Refresh</DIV>
<DIV> </DIV>
<DIV dir=ltr align=left>End Sub</DIV>
<DIV> </DIV>
<DIV dir=ltr align=left>Public Sub AddText()<BR>Dim pTextElement As
ITextElement<BR>Set pTextElement = New TextElement</DIV>
<DIV> </DIV>
<DIV dir=ltr align=left> ''retrieve the document title<BR> Dim
pDocumentTitle As String<BR> Dim pDocument As IDocument<BR> Set
pDocument = Application.Document<BR> pDocumentTitle =
pDocument.Title<BR> <BR>''display<BR>pTextElement.Text = "The date / time
is : " & Now & vbCrLf &
_<BR>
"The document name is : " & pDocumentTitle</DIV>
<DIV> </DIV>
<DIV dir=ltr align=left>''create a point for the location of the text<BR>Dim
pPoint As IPoint<BR>Set pPoint = New Point</DIV>
<DIV> </DIV>
<DIV dir=ltr align=left>'enter the x and y values of your text element
here<BR>pPoint.x = 2<BR>pPoint.y = 2<BR>'</DIV>
<DIV> </DIV>
<DIV dir=ltr align=left>AddElement pTextElement, pPoint</DIV>
<DIV> </DIV>
<DIV dir=ltr align=left>End Sub<BR></FONT></SPAN></DIV></DIV><BR>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Sykes, John
[mailto:John.Sykes@dep.state.fl.us] <BR><B>Sent:</B> Tuesday, February 28,
2006 10:04 AM<BR><B>To:</B> shrug-L@lists.dep.state.fl.us<BR><B>Subject:</B>
shrug-l: System Variable in Annotation<BR></FONT><BR></DIV>
<DIV></DIV><!-- Converted from text/rtf format -->
<P><FONT face=Arial size=4>Does anyone here know how you can include a system
variable, such as the file name or today's date, last modified date, etc. in a
layout annotation (I keep forgetting to update the "Revised:" dates on my
?/&@?$!**@%*^ printed maps). I've pretty well mastered modifying
labels using Visual Basic scripts, but the same techniques don't appear to
work on text annotations. I tried using VB scripts, but all the script
delineators I tried printed out literally (e.g., single quotes, double quotes,
left & right brackets, etc.).</FONT></P>
<P><B><FONT face="Monotype Corsiva" size=5>-- John</FONT></B>
</P></BLOCKQUOTE></BODY></HTML>