Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / May 2008

Tip: Looking for answers? Try searching our database.

"Is/ Is not" toggle

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dylan - 14 May 2008 16:33 GMT
Is it possible to have a text field  "Is/ Is not" on a  document where one of
them is always struckthrough and the user can click on the field to toggle
between "Is" and "Is not"?

Regards
D Dawson
Doug Robbins - Word MVP - 14 May 2008 20:37 GMT
Get the Checkbox Add-in that can be down loaded from fellow MVP Charles
Kenyon's website at:

http://addbalance.com/word/download.htm#PageStart

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Is it possible to have a text field  "Is/ Is not" on a  document where one
> of
[quoted text clipped - 3 lines]
> Regards
> D Dawson
Tony Jollans - 15 May 2008 09:02 GMT
Charles Kenyon is an MVP? I didn't know that, and I haven't seen him around
for a year or two.

Signature

Enjoy,
Tony

> Get the Checkbox Add-in that can be down loaded from fellow MVP Charles
> Kenyon's website at:
[quoted text clipped - 9 lines]
>> Regards
>> D Dawson
Doug Robbins - Word MVP - 15 May 2008 09:54 GMT
Once an MVP, always an MVP.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Charles Kenyon is an MVP? I didn't know that, and I haven't seen him
> around for a year or two.
[quoted text clipped - 12 lines]
>>> Regards
>>> D Dawson
Dylan - 15 May 2008 10:55 GMT
Hi Doug

Using Charles' info and Bill Coan's info at:
http://word.mvps.org/faqs/macrosvba/AssignMacroToText.htm,
I've created a macrobutton which toggles the textstrings. But I'm stuck at
formatting the font, in order to strikethrough one of the options. Can you
please help?

Here's the code I'm working with;
(Note that lines 12-15 are the lines I've added in an attempt to format the
text string") I've also carried out a search to find a solution to formatting
the font of a defined textstring, in the the other newsgroups, but haven't
come up with anything.

Sub TextCarousel()
Dim str1 As String, str2 As String, str3 As String, str4 As String
str1 = "Yes"
str2 = "No"
str3 = "Yes"
str4 = "No"

Select Case Mid(Selection.Fields(1).Code.Text, 26)
 Case str1
   Selection.Fields(1).Code.Text = _
  "macrobutton TextCarousel " & str1 & str2
 str2.Select
   With Selection.Font
       .StrikeThrough = True
   End With
 Case str2
   Selection.Fields(1).Code.Text = _
   "macrobutton TextCarousel " & str3 & str4
 str3.Select
   With Selection.Font
       .StrikeThrough = True
   End With
 Case Else
   Selection.Fields(1).Code.Text = _
   "macrobutton TextCarousel " & str3
End Select
End Sub

> Once an MVP, always an MVP.
>
[quoted text clipped - 14 lines]
> >>> Regards
> >>> D Dawson
Doug Robbins - Word MVP - 16 May 2008 04:38 GMT
Set up the MacroButton in the document with

{ MACROBUTTON SymbolCarousel No/}

And immediately after the closing } type

YesNo

Select the Yes and from the Insert menu select Bookmarks and enter the
bookmark name Yes.  Then select the No of YesNo and create a bookmark for it
with the name of No.  To select those words individually, you may have to
uncheck the "When selecting, automatically select entire word" under
Tools>Options>Edit.

Select the word Yes and format the font as Strikethrough.  Select the word
No and format it as Strikethrough and Hidden.

Then use the following code:

Sub SymbolCarousel()

Dim Str1 as String, Str2 As String

Str1 = "Yes/"
Str2 = "No/"

Select Case (Mid(Selection.Fields(1).Code.Text, 29)
   Case Str1
       Selection.Fields(1).Code.Text = " MACROBUTTON SymbolCarousel " &
Str2
       With ActiveDocument
           .Bookmarks("No").Range.Font.Hidden = True
           .Bookmarks("Yes").Range.Font.Hidden = False
       End With
   Case Str2
       Selection.Fields(1).Code.Text = " MACROBUTTON SymbolCarousel " &
Str1
       With ActiveDocument
           .Bookmarks("No").Range.Font.Hidden = False
           .Bookmarks("Yes").Range.Font.Hidden = True
       End With
End Select

End Sub

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hi Doug
>
[quoted text clipped - 60 lines]
>> >>> Regards
>> >>> D Dawson
Dylan - 16 May 2008 10:05 GMT
Hi Doug!

I tried fiddling with it - trying to move the "Yes" bookmark on front of the
{}Field, but it doesn't work.

It would be good to have it so that it always says Yes/No rather than toggle
between yes/No  and  No/Yes.

Thanks for helping.
Dylan

> Set up the MacroButton in the document with
>
[quoted text clipped - 105 lines]
> >> >>> Regards
> >> >>> D Dawson
Doug Robbins - Word MVP - 17 May 2008 09:56 GMT
Using the following code and with the bookmark Yes before the field and
containing a struck through Yes and the bookmark No after the field and
containing the struck through No, it works as desired.  But note that the
position of the macro button changes so that it is necessary to double click
on the text that is not struck out to get it to work.  You must of course
start with one of the strings in the MacroButton field.  That is either a
Yes/ or a /No.

Dim Str1 As String, Str2 As String

Str1 = "Yes/"
Str2 = "/No"
Select Case Mid(Selection.Paragraphs(1).Range.Fields(1).Code.Text, 29)
   Case Str2
       Selection.Paragraphs(1).Range.Fields(1).Code.Text = " MACROBUTTON
SymbolCarousel " & Str1
       With ActiveDocument
           .Bookmarks("No").Range.Font.Hidden = False
           .Bookmarks("Yes").Range.Font.Hidden = True
       End With
   Case Str1
       Selection.Paragraphs(1).Range.Fields(1).Code.Text = " MACROBUTTON
SymbolCarousel " & Str2
       With ActiveDocument
           .Bookmarks("No").Range.Font.Hidden = True
           .Bookmarks("Yes").Range.Font.Hidden = False
       End With
End Select

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hi Doug!
>
[quoted text clipped - 124 lines]
>> >> >>> Regards
>> >> >>> D Dawson
Tony Jollans - 15 May 2008 13:34 GMT
Oh, I quite agree. I didn't realise he had been one before.

Signature

Enjoy,
Tony

> Once an MVP, always an MVP.
>
[quoted text clipped - 14 lines]
>>>> Regards
>>>> D Dawson
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.