Re: A Macro that calls another Macro
- From: Trefilov22 <Trefilov22@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 22 Aug 2007 06:22:05 -0700
That would be fine if it were within a Form. This is just in general
documents. Basically they'll type up something and then run this macro and
then choose who they are (it would be easier if I could just assign their own
signature macro to them on their own PC, but occassionally they type up
something for someone else and would need to use their signature).
In WordPerfect 10 they use a keystroke (ctrl-shft-M) and it brings up a box
with all of their names listed, then they just click the name they want, and
bam, in goes the signature. I would like to do something similiar, if not
the same in Word 2007.
Thanks Graham for your response, I appreciate it!
Brian
"Graham Mayor" wrote:
I take it that this is Word prior to 2007?.
A userform would bemore elegant, but you can create a simple macro that
would allow you to enter a single number to insert the appropriate autotext.
eg
Sub ChooseSig()
Dim iUser As Integer
Dim sType As String
iUser = InputBox("For John, enter 1" & vbCr & _
"For Fred, enter 2" & vbCr & _
"For Bill, enter 3" & vbCr & _
"For Susan, enter 4" & vbCr & _
"For Joan, enter 5" & vbCr & _
"For Alan, enter 6" & vbCr & _
"For Keith, enter 7" & vbCr & _
"For Elsie, enter 8" & vbCr & _
"For John, enter 9", , 1)
Select Case iUser
Case 1
NormalTemplate.AutoTextEntries("John's Sig").Insert _
Where:=Selection.Range, RichText:=True
Case 2
NormalTemplate.AutoTextEntries("Fred's Sig").Insert _
Where:=Selection.Range, RichText:=True
'etc
End Select
End Sub
Add the rest of the Case statements and change the names and autotext names
as appropriate.
You can make this much simpler and do away with the Case statements if you
re-name the autotexts to match the numbers eg
Sig1 for John, Sig2 for Fred etc.
Then
Sub ChooseSig()
Dim iUser As Integer
Dim sType As String
iUser = InputBox("For John, enter 1" & vbCr & _
"For Fred, enter 2" & vbCr & _
"For Bill, enter 3" & vbCr & _
"For Susan, enter 4" & vbCr & _
"For Joan, enter 5" & vbCr & _
"For Alan, enter 6" & vbCr & _
"For Keith, enter 7" & vbCr & _
"For Elsie, enter 8" & vbCr & _
"For John, enter 9", , 1)
NormalTemplate.AutoTextEntries("Sig" & iUser).Insert _
Where:=Selection.Range, RichText:=True
End Sub
It wouldn't be too much of a stretch to enable each user to have his own
signature as default, but this should keep you going for a bit
http://www.gmayor.com/installing_macro.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Trefilov22 wrote:
I thought about using the AUTOTEXTLIST but that won't work as the
documents are different each time, and therefore won't have the
prompt or trigger where they will right click to open the list. I
don't want them to have to type in a word to right click on just to
bring up that list where they want the signature.
"Stefan Blom" wrote:
Have you considered using an AUTOTEXTLIST field? See
http://word.mvps.org/FAQs/TblsFldsFms/AutoTextList.htm.
--
Stefan Blom
Microsoft Word MVP
"Trefilov22" <Trefilov22@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6A22013B-2F53-48F0-99F6-D0CB4A9B2776@xxxxxxxxxxxxxxxx
Here's what I need to do. I need to create a macro that opens a
list that the user can choose a specific person from. A little
background, I have signature blocks for nine people set as
autotext. I need to create a macro
that brings up a list of those nine people, that a user can choose
one from.
Once the user chooses that person, it drops in the signautre block
for that
particular person from their autotext entry. Is this possible? And
if so, can someone steer me in the right direction?
- Follow-Ups:
- Re: A Macro that calls another Macro
- From: Graham Mayor
- Re: A Macro that calls another Macro
- References:
- Re: A Macro that calls another Macro
- From: Stefan Blom
- Re: A Macro that calls another Macro
- From: Graham Mayor
- Re: A Macro that calls another Macro
- Prev by Date: Re: Removal off all hyperlinks in a document at once?
- Next by Date: Re: Printing specific page problem
- Previous by thread: Re: A Macro that calls another Macro
- Next by thread: Re: A Macro that calls another Macro
- Index(es):
Relevant Pages
|