How to create a text strike-through macro using a ck box to initia

G

Guest

I am working with real-estate contracts and there are times when a paragraph
(or part of) can be deleted. I would like to put a check box to the side
that when checked, will strike-through the test that can be deleted. Any
thoughts? Thanks!
 
G

Guest

Why not just highlight the paragraph and right-click and select font and
select strike through or just create a macro to do that for you?
 
G

Guest

Good idea, but I'm working on a document that has form fields and the doc
will be password protected, so the end user can't make any changes to the
text. I know I saw it done somewhere, I just can't for the life of me
remember where I saw it, 'cause if I did, then I might be able to reverse
engineer it!

/steve
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?c21jY295?=,
I'm working on a document that has form fields and the doc
will be password protected, so the end user can't make any changes to the
text. I know I saw it done somewhere, I just can't for the life of me
remember where I saw it, 'cause if I did, then I might be able to reverse
engineer it!
You should address this to one of the word.vba newsgroups. Since this is an
end-user group, you're more likely to get quick help there. You need to include the
version of Word you're working with.

Right off hand, I'd say look at the checkboxes in the Control Toolbox. Try putting
one in a FRAME (from the Forms toolbar). The reason I suggest this is that these
have an event that will fire when the checkbox is clicked. The form fields only
trigger when the user enters or exits.

On my website, in the Forms section, you'll find the basic code for
unprotecting/reprotecting without losing user input. Record a macro to apply the
font formatting, and put that between the unprotect/reprotect lines.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in
the newsgroup and not by e-mail :)
 
G

Greg

Using the checkbox in a frame method as Cindy suggested, you could
bookmark the text (call it "Test") and use a macro something like this.

Private Sub CheckBox1_Change()
ActiveDocument.Unprotect
If Me.CheckBox1.Value = -1 Then
ActiveDocument.Bookmarks("Test").Range.Font.StrikeThrough = True
Else
ActiveDocument.Bookmarks("Test").Range.Font.StrikeThrough = False
End If
ActiveDocument.Protect wdAllowOnlyFormFields, NoReset:=True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top