Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.word.vba.general
external usenet poster
 
Posts: 8
Default Create Macro using VBA / Macro

I do appreciate your concern about writing into someone elses normal.dot,
and can ensure you that I would not send it to someone who do not wish to
have the shortcut ALT+V to paste unformatted text. I could even make it so
that in the word document I send the users it would be explained and they
would require to press ALT+V to start the macro instead of making it
document_open() like suggested earlier. Then ALT+V would simply kick of the
macro (which I do not know how to write yet) and after that ALT+V would be
their new key binding for pasting unformatted text, which I know so many
users would appreciate.

As I tried to express earlier I already know how to deal with global
template and using a global template would entirely overwrite their
normal.dot and then I do think it would be a lot more appreciated by the
users if I only added a small code rather than overwriting the lot.

To let the users manipulate their own normal.dot code is not an option, some
of the users are not that computer literate, in fact some do not even know
how to record a macro, so messing about with VB is out of the question.

I am honestly not trying to be rude, but merely save some time, so if you
can not answer the question on whether it is possible to create a macro that
can write another macro and tell me how to do it and write it to normal.dot,
or if someone can tell me it is impossible then please do not reply, it only
waste yours and my time.

Thank you,
Rene


"Rene Petersen" wrote:

This great code (code1) is found in here to paste unformatted text, I have
used this and assigned it to a shortcut key using code 2.

Now I would very much like to share this with my collegues and I therefore
need to know how I use a third macro to add the first macro (code 1) to my
collegues normal.dot and run code two to assign key.

I will send them the code using a document with the macro.

'Code 1
Sub PasteUnfText()
On Error GoTo Oops

Selection.PasteSpecial DataType:=wdPasteText, Placement:= _
wdInLine
End
Oops:
Beep
End Sub

'Code 2
Sub AssignKey()

CustomizationContext = NormalTemplate
KeyBindings.Add KeyCategory:=wdKeyCategoryCommand, _
Command:="PasteUnfText", _
KeyCode:=BuildKeyCode(wdKeyAlt, wdKeyV)

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.word.vba.general
external usenet poster
 
Posts: 1
Default Create Macro using VBA / Macro

Hi Rene,

You are confusing normal.dot which is a specific global template with global
template. When I start Word I load about 15 different global templates! Each
contributes different code and interface items. If you look at the links I
gave you in earlier posts you will see this explained and find step-by-step
instructions on how to create a global template that is loaded in addition
to normal.dot.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"Rene Petersen" wrote in message
...
I do appreciate your concern about writing into someone else's normal.dot,
and can ensure you that I would not send it to someone who do not wish to
have the shortcut ALT+V to paste unformatted text. I could even make it so
that in the word document I send the users it would be explained and they
would require to press ALT+V to start the macro instead of making it
document_open() like suggested earlier. Then ALT+V would simply kick of
the
macro (which I do not know how to write yet) and after that ALT+V would be
their new key binding for pasting unformatted text, which I know so many
users would appreciate.

As I tried to express earlier I already know how to deal with global
template and using a global template would entirely overwrite their
normal.dot and then I do think it would be a lot more appreciated by the
users if I only added a small code rather than overwriting the lot.

To let the users manipulate their own normal.dot code is not an option,
some
of the users are not that computer literate, in fact some do not even know
how to record a macro, so messing about with VB is out of the question.

I am honestly not trying to be rude, but merely save some time, so if you
can not answer the question on whether it is possible to create a macro
that
can write another macro and tell me how to do it and write it to
normal.dot,
or if someone can tell me it is impossible then please do not reply, it
only
waste yours and my time.

Thank you,
Rene


"Rene Petersen" wrote:

This great code (code1) is found in here to paste unformatted text, I
have
used this and assigned it to a shortcut key using code 2.

Now I would very much like to share this with my collegues and I
therefore
need to know how I use a third macro to add the first macro (code 1) to
my
collegues normal.dot and run code two to assign key.

I will send them the code using a document with the macro.

'Code 1
Sub PasteUnfText()
On Error GoTo Oops

Selection.PasteSpecial DataType:=wdPasteText, Placement:= _
wdInLine
End
Oops:
Beep
End Sub

'Code 2
Sub AssignKey()

CustomizationContext = NormalTemplate
KeyBindings.Add KeyCategory:=wdKeyCategoryCommand, _
Command:="PasteUnfText", _
KeyCode:=BuildKeyCode(wdKeyAlt, wdKeyV)

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.word.vba.general
external usenet poster
 
Posts: 14
Default Create Macro using VBA / Macro

Your code for pasting unformatted text could be made much simpler:
Sub PasteUnformattedText()
On Error Resume Next
Selection.PasteSpecial DataType:=wdPasteText
End Sub

I would also suggest attaching this to a toolbar button instead of a
keyboard shortcut - I believe most users would find that easier to use, even
if it's not as quick for those of us who can remember keyboard shortcuts.

As for distributing the code, there's all sorts of ways, depending on
whether you want to do it from a text file or copy from a vba module in one
file to another, and whether you want to add the code to an existing module
or create a new module for it.

Cheers


"Rene Petersen" wrote in message
...
I do appreciate your concern about writing into someone else's normal.dot,
and can ensure you that I would not send it to someone who do not wish to
have the shortcut ALT+V to paste unformatted text. I could even make it so
that in the word document I send the users it would be explained and they
would require to press ALT+V to start the macro instead of making it
document_open() like suggested earlier. Then ALT+V would simply kick of

the
macro (which I do not know how to write yet) and after that ALT+V would be
their new key binding for pasting unformatted text, which I know so many
users would appreciate.

As I tried to express earlier I already know how to deal with global
template and using a global template would entirely overwrite their
normal.dot and then I do think it would be a lot more appreciated by the
users if I only added a small code rather than overwriting the lot.

To let the users manipulate their own normal.dot code is not an option,

some
of the users are not that computer literate, in fact some do not even know
how to record a macro, so messing about with VB is out of the question.

I am honestly not trying to be rude, but merely save some time, so if you
can not answer the question on whether it is possible to create a macro

that
can write another macro and tell me how to do it and write it to

normal.dot,
or if someone can tell me it is impossible then please do not reply, it

only
waste yours and my time.

Thank you,
Rene


"Rene Petersen" wrote:

This great code (code1) is found in here to paste unformatted text, I

have
used this and assigned it to a shortcut key using code 2.

Now I would very much like to share this with my collegues and I

therefore
need to know how I use a third macro to add the first macro (code 1) to

my
collegues normal.dot and run code two to assign key.

I will send them the code using a document with the macro.

'Code 1
Sub PasteUnfText()
On Error GoTo Oops

Selection.PasteSpecial DataType:=wdPasteText, Placement:= _
wdInLine
End
Oops:
Beep
End Sub

'Code 2
Sub AssignKey()

CustomizationContext = NormalTemplate
KeyBindings.Add KeyCategory:=wdKeyCategoryCommand, _
Command:="PasteUnfText", _
KeyCode:=BuildKeyCode(wdKeyAlt, wdKeyV)

End Sub



  #4   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.word.vba.general
external usenet poster
 
Posts: 8
Default Create Macro using VBA / Macro

Thank you very much for your feedback.

Rene


"macropod" wrote:

Your code for pasting unformatted text could be made much simpler:
Sub PasteUnformattedText()
On Error Resume Next
Selection.PasteSpecial DataType:=wdPasteText
End Sub

I would also suggest attaching this to a toolbar button instead of a
keyboard shortcut - I believe most users would find that easier to use, even
if it's not as quick for those of us who can remember keyboard shortcuts.

As for distributing the code, there's all sorts of ways, depending on
whether you want to do it from a text file or copy from a vba module in one
file to another, and whether you want to add the code to an existing module
or create a new module for it.

Cheers


"Rene Petersen" wrote in message
...
I do appreciate your concern about writing into someone else's normal.dot,
and can ensure you that I would not send it to someone who do not wish to
have the shortcut ALT+V to paste unformatted text. I could even make it so
that in the word document I send the users it would be explained and they
would require to press ALT+V to start the macro instead of making it
document_open() like suggested earlier. Then ALT+V would simply kick of

the
macro (which I do not know how to write yet) and after that ALT+V would be
their new key binding for pasting unformatted text, which I know so many
users would appreciate.

As I tried to express earlier I already know how to deal with global
template and using a global template would entirely overwrite their
normal.dot and then I do think it would be a lot more appreciated by the
users if I only added a small code rather than overwriting the lot.

To let the users manipulate their own normal.dot code is not an option,

some
of the users are not that computer literate, in fact some do not even know
how to record a macro, so messing about with VB is out of the question.

I am honestly not trying to be rude, but merely save some time, so if you
can not answer the question on whether it is possible to create a macro

that
can write another macro and tell me how to do it and write it to

normal.dot,
or if someone can tell me it is impossible then please do not reply, it

only
waste yours and my time.

Thank you,
Rene


"Rene Petersen" wrote:

This great code (code1) is found in here to paste unformatted text, I

have
used this and assigned it to a shortcut key using code 2.

Now I would very much like to share this with my collegues and I

therefore
need to know how I use a third macro to add the first macro (code 1) to

my
collegues normal.dot and run code two to assign key.

I will send them the code using a document with the macro.

'Code 1
Sub PasteUnfText()
On Error GoTo Oops

Selection.PasteSpecial DataType:=wdPasteText, Placement:= _
wdInLine
End
Oops:
Beep
End Sub

'Code 2
Sub AssignKey()

CustomizationContext = NormalTemplate
KeyBindings.Add KeyCategory:=wdKeyCategoryCommand, _
Command:="PasteUnfText", _
KeyCode:=BuildKeyCode(wdKeyAlt, wdKeyV)

End Sub




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a macro to create excel line graph with coloured pointers anddata lables anuj datta Charts and Charting in Excel 1 September 30th 09 04:04 PM
Using a macro to create a macro in another workbook Gizmo63 Excel Worksheet Functions 2 May 15th 06 09:48 AM
Can macro create another macro? VK Excel Programming 11 June 6th 05 07:28 PM
Macro to create macro Carl Bowman Excel Discussion (Misc queries) 2 February 6th 05 10:49 AM
Have a Macro create a Macro Langy Excel Programming 2 August 2nd 04 12:38 PM


All times are GMT +1. The time now is 09:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"