Macro to delete instructions after reading

M

mgirving

How to I create a macro to enable a reader to use a keyboard shortcut (eg.
Control + D) that deletes the instruction page after the reader has read it.
I have no idea how to go about doing this in Word, so if you could walk me
through it, I would be extremely grateful. Thanks.
 
C

Cindy M.

Hi =?Utf-8?B?bWdpcnZpbmc=?=,
How to I create a macro to enable a reader to use a keyboard shortcut (eg.
Control + D) that deletes the instruction page after the reader has read it.
I have no idea how to go about doing this in Word, so if you could walk me
through it, I would be extremely grateful.
Well, the first problem is identifying the "instruction page". Will this
reliably be the first page in the document? Or is there something on the page
you can use to uniquely identify it?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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

Graham Mayor

I think I would be inclined to approach this from another direction and pop
up a message box containing all the help information from an autonew macro
in that document's dedicated template. eg

Sub SutoNew()
Dim sHelpText As String

sHelpText = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed
diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Lorem
ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh
euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. " & vbCr &
vbCr & _
"Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper
suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel
eum iriure dolor in hendrerit in vulputate velit esse molestie consequat,
vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et
iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis
dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer
adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore
magna aliquam erat volutpa"

MsgBox sHelpText, vbInformation, "Instructions"
End Sub

You can display quite a lot of text in this manner and it will not screw up
your document when you delete a page - as there is no page to delete.


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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