Dave
Wed Sep 12 15:12:15 CDT 2007
Of course, to make it "dynamic", you would want globals
TblArg$ and TblVal$
and set them to what you want, when you want.
>There's no equivalent of
>Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
>but you could hit a menu button, leaving the cursor at your symbol:
>in Thisdocument:
>Option Explicit
>
>Private Sub Document_Open()
> Dim CB As CommandBar, CBC As CommandBarControl
> Set CB = Application.CommandBars.ActiveMenuBar
> CB.Reset
> Set CBC = CB.Controls.Add(msoControlButton, , , , True)
> CBC.FaceId = 342 ' my favorite
> CBC.OnAction = "Doit"
>End Sub
>
>Private Sub Document_Close()
> Application.CommandBars.ActiveMenuBar.Reset
>End Sub
>
>Sub Doit()
> Const TblArg = "XO", TblVal = "OX"
> Dim ch$, i%
> Selection.Collapse wdCollapseStart
> ch = Chr$(Asc(Selection.Text & " "))
> i = InStr(1, TblArg, ch)
> If i > 0 Then
> Selection.Delete
> Selection.TypeText Mid$(TblVal, i, 1)
> End If
>End Sub
>
>"robotman" <robotman@gmail.com> wrote in message
>news:1189621349.116439.28040@r29g2000hsg.googlegroups.com...
>> I'm trying to set up a roster where I can click on a symbol in front
>> of a person's name and it will change from an "X" to a "O".
>>
>> I'm an expert at Excel VBA, but not familiar with Word VBA.
>>
>> Can someone give me some ideas on how I could set up a macro to allow
>> the user to check on a symbol (or character) in front of a person's
>> name in a list and it would toggle between 2 or 3 symbols?
>>
>> The list will be dynamic, so I need to write some generic code that
>> can identify which symbol is clicked on and toggle it to the next
>> symbol.
>>
>> Thanks.
>>
>> John
>
>
>
>----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
>
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
>----= East and West-Coast Server Farms - Total Privacy via Encryption =----
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----