A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Custom icons



 
 
Thread Tools Display Modes
  #1  
Old December 1st, 2009, 04:24 PM posted to microsoft.public.word.newusers
geotso[_2_]
external usenet poster
 
Posts: 56
Default Custom icons

In word 2007, under word options customize modify there is a "Modify
button" dialog box. Is there a way to add some icons of mine?
--
geotso
---- ---- --- -- -- - -
Please, remove hyphens to contact me
---- ---- --- -- -- - -
  #2  
Old December 1st, 2009, 06:28 PM posted to microsoft.public.word.newusers
Stefan Blom[_3_]
external usenet poster
 
Posts: 4,556
Default Custom icons

Creating custom icons can be done in Word 2007, but it's more difficult than
in previous versions. Take a look at the article at
http://gregmaxey.mvps.org/Ribbon_Custom_Icons.htm.

--
Stefan Blom
Microsoft Word MVP



"geotso" wrote in message
...
In word 2007, under word options customize modify there is a "Modify
button" dialog box. Is there a way to add some icons of mine?
--
geotso
---- ---- --- -- -- - -
Please, remove hyphens to contact me
---- ---- --- -- -- - -



  #3  
Old December 2nd, 2009, 03:57 PM posted to microsoft.public.word.newusers
geotso[_2_]
external usenet poster
 
Posts: 56
Default Custom icons

"Stefan Blom" wrote:

Creating custom icons can be done in Word 2007, but it's more difficult than
in previous versions. Take a look at the article at
http://gregmaxey.mvps.org/Ribbon_Custom_Icons.htm.

--
Stefan Blom
Microsoft Word MVP


Stefan,

Thank you very much for your answer.
I followed the link and the instructions and finally I created a custom tab,
with a custom group and a custom image within it. However there is a minor
problem yet:
I can't make it run an assigned macro. When I click the button I get an
error message "The macro cannot be found or has been disabled...", although
the macro is saved in Normal.dotm and all security restrictions are disabled.

Here is the script produced by Custom UI Editor (partially edited by me):
customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
ribbon startFromScratch="false"
tabs
tab id="geotso" label="geotso"
group id="geotsoGroup" label="geotso"
button id="removeHyperlinks" label="Remove all hyperlinks"
image="testico" onAction="RemoveHyperlinks()" /
/group
/tab
/tabs
/ribbon
/customUI

and here is the macro:
Sub RemoveHyperlinks()
Dim oField As Field
For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldHyperlink Then
oField.Unlink
End If
Next
Set oField = Nothing
End Sub

Could you help me a little more, please?

Thanks again
  #4  
Old December 2nd, 2009, 03:57 PM posted to microsoft.public.word.newusers
geotso[_2_]
external usenet poster
 
Posts: 56
Default Custom icons

"Stefan Blom" wrote:

Creating custom icons can be done in Word 2007, but it's more difficult than
in previous versions. Take a look at the article at
http://gregmaxey.mvps.org/Ribbon_Custom_Icons.htm.

--
Stefan Blom
Microsoft Word MVP


Stefan,

Thank you very much for your answer.
I followed the link and the instructions and finally I created a custom tab,
with a custom group and a custom image within it. However there is a minor
problem yet:
I can't make it run an assigned macro. When I click the button I get an
error message "The macro cannot be found or has been disabled...", although
the macro is saved in Normal.dotm and all security restrictions are disabled.

Here is the script produced by Custom UI Editor (partially edited by me):
customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
ribbon startFromScratch="false"
tabs
tab id="geotso" label="geotso"
group id="geotsoGroup" label="geotso"
button id="removeHyperlinks" label="Remove all hyperlinks"
image="testico" onAction="RemoveHyperlinks()" /
/group
/tab
/tabs
/ribbon
/customUI

and here is the macro:
Sub RemoveHyperlinks()
Dim oField As Field
For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldHyperlink Then
oField.Unlink
End If
Next
Set oField = Nothing
End Sub

Could you help me a little more, please?

Thanks again
  #5  
Old December 2nd, 2009, 04:23 PM posted to microsoft.public.word.newusers
Jay Freedman
external usenet poster
 
Posts: 9,488
Default Custom icons

geotso wrote:
"Stefan Blom" wrote:

Creating custom icons can be done in Word 2007, but it's more
difficult than in previous versions. Take a look at the article at
http://gregmaxey.mvps.org/Ribbon_Custom_Icons.htm.

--
Stefan Blom
Microsoft Word MVP


Stefan,

Thank you very much for your answer.
I followed the link and the instructions and finally I created a
custom tab, with a custom group and a custom image within it. However
there is a minor problem yet:
I can't make it run an assigned macro. When I click the button I get
an error message "The macro cannot be found or has been disabled...",
although the macro is saved in Normal.dotm and all security
restrictions are disabled.

Here is the script produced by Custom UI Editor (partially edited by
me): customUI
xmlns="http://schemas.microsoft.com/office/2006/01/customui" ribbon
startFromScratch="false" tabs
tab id="geotso" label="geotso"
group id="geotsoGroup" label="geotso"
button id="removeHyperlinks" label="Remove all hyperlinks"
image="testico" onAction="RemoveHyperlinks()" /
/group
/tab
/tabs
/ribbon
/customUI

and here is the macro:
Sub RemoveHyperlinks()
Dim oField As Field
For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldHyperlink Then
oField.Unlink
End If
Next
Set oField = Nothing
End Sub

Could you help me a little more, please?

Thanks again


In the Custom UI Editor, try removing the parentheses from the onAction
item:

onAction="RemoveHyperlinks"

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.


  #6  
Old December 2nd, 2009, 04:23 PM posted to microsoft.public.word.newusers
Jay Freedman
external usenet poster
 
Posts: 9,488
Default Custom icons

geotso wrote:
"Stefan Blom" wrote:

Creating custom icons can be done in Word 2007, but it's more
difficult than in previous versions. Take a look at the article at
http://gregmaxey.mvps.org/Ribbon_Custom_Icons.htm.

--
Stefan Blom
Microsoft Word MVP


Stefan,

Thank you very much for your answer.
I followed the link and the instructions and finally I created a
custom tab, with a custom group and a custom image within it. However
there is a minor problem yet:
I can't make it run an assigned macro. When I click the button I get
an error message "The macro cannot be found or has been disabled...",
although the macro is saved in Normal.dotm and all security
restrictions are disabled.

Here is the script produced by Custom UI Editor (partially edited by
me): customUI
xmlns="http://schemas.microsoft.com/office/2006/01/customui" ribbon
startFromScratch="false" tabs
tab id="geotso" label="geotso"
group id="geotsoGroup" label="geotso"
button id="removeHyperlinks" label="Remove all hyperlinks"
image="testico" onAction="RemoveHyperlinks()" /
/group
/tab
/tabs
/ribbon
/customUI

and here is the macro:
Sub RemoveHyperlinks()
Dim oField As Field
For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldHyperlink Then
oField.Unlink
End If
Next
Set oField = Nothing
End Sub

Could you help me a little more, please?

Thanks again


In the Custom UI Editor, try removing the parentheses from the onAction
item:

onAction="RemoveHyperlinks"

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.


  #7  
Old December 2nd, 2009, 06:06 PM posted to microsoft.public.word.newusers
Greg Maxey[_2_]
external usenet poster
 
Posts: 649
Default Custom icons

Do as Jay says and remove the parenthesis from the onAction statement. When
that is fixed and based on the code you posted the next error is going to be
"Wrong number of arguments or invalid property assignment."

Your macro in Normal.dotm needs the control passed as an argument:

Sub RemoveHyperlinks(control As IRibbonControl)
MsgBox "Test"
Dim oField As Field
For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldHyperlink Then
oField.Unlink
End If
Next
Set oField = Nothing
End Sub

geotso wrote:
"Stefan Blom" wrote:

Creating custom icons can be done in Word 2007, but it's more
difficult than in previous versions. Take a look at the article at
http://gregmaxey.mvps.org/Ribbon_Custom_Icons.htm.

--
Stefan Blom
Microsoft Word MVP


Stefan,

Thank you very much for your answer.
I followed the link and the instructions and finally I created a
custom tab, with a custom group and a custom image within it. However
there is a minor problem yet:
I can't make it run an assigned macro. When I click the button I get
an error message "The macro cannot be found or has been disabled...",
although the macro is saved in Normal.dotm and all security
restrictions are disabled.

Here is the script produced by Custom UI Editor (partially edited by
me): customUI
xmlns="http://schemas.microsoft.com/office/2006/01/customui" ribbon
startFromScratch="false" tabs
tab id="geotso" label="geotso"
group id="geotsoGroup" label="geotso"
button id="removeHyperlinks" label="Remove all hyperlinks"
image="testico" onAction="RemoveHyperlinks()" /
/group
/tab
/tabs
/ribbon
/customUI

and here is the macro:
Sub RemoveHyperlinks()
Dim oField As Field
For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldHyperlink Then
oField.Unlink
End If
Next
Set oField = Nothing
End Sub

Could you help me a little more, please?

Thanks again



  #8  
Old December 2nd, 2009, 07:03 PM posted to microsoft.public.word.newusers
Greg Maxey[_2_]
external usenet poster
 
Posts: 649
Default Custom icons

By passing the control as an argument to the VBA callback you can using a
single procedure in your RibbonX. For example the following RibbonX uses
the same onAction callback "MyMultiPurposeMacro."

?xml version="1.0" encoding="UTF-8" standalone="yes"?
customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
ribbon startFromScratch="false"
tabs
tab id="geotso" label="geotso"
group id="geotsoGroup" label="geotso"
button id="BTN1" label="Remove Hyperlinks"
onAction="MyMultiPurposeMacro"/
button id="BTN2" label="Update Fields"
onAction="MyMultiPurposeMacro"/
button id="BTN3" label="Insert Date"
onAction="MyMultiPurposeMacro"/
button id="BTN4" label="Insert Time"
onAction="MyMultiPurposeMacro"/
/group
/tab
/tabs
/ribbon
/customUI

Sub MyMultiPurposeMacro(control As IRibbonControl)
Dim oField As Field
Select Case control.ID
Case "BTN1"
For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldHyperlink Then
oField.Unlink
End If
Next
Case "BTN2"
For Each oField In ActiveDocument.Fields
oField.Update
Next
Case "BTN3"
Set oField = Selection.Fields.Add(Range:=Selection.Range,
Type:=wdFieldDate)
oField.Unlink
Case "BTN4"
Set oField = Selection.Fields.Add(Range:=Selection.Range,
Type:=wdFieldTime, Text:="\@ HH:mm")
oField.Unlink
End Select
Set oField = Nothing
End Sub

geotso wrote:
"Stefan Blom" wrote:

Creating custom icons can be done in Word 2007, but it's more
difficult than in previous versions. Take a look at the article at
http://gregmaxey.mvps.org/Ribbon_Custom_Icons.htm.

--
Stefan Blom
Microsoft Word MVP


Stefan,

Thank you very much for your answer.
I followed the link and the instructions and finally I created a
custom tab, with a custom group and a custom image within it. However
there is a minor problem yet:
I can't make it run an assigned macro. When I click the button I get
an error message "The macro cannot be found or has been disabled...",
although the macro is saved in Normal.dotm and all security
restrictions are disabled.

Here is the script produced by Custom UI Editor (partially edited by
me): customUI
xmlns="http://schemas.microsoft.com/office/2006/01/customui" ribbon
startFromScratch="false" tabs
tab id="geotso" label="geotso"
group id="geotsoGroup" label="geotso"
button id="removeHyperlinks" label="Remove all hyperlinks"
image="testico" onAction="RemoveHyperlinks()" /
/group
/tab
/tabs
/ribbon
/customUI

and here is the macro:
Sub RemoveHyperlinks()
Dim oField As Field
For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldHyperlink Then
oField.Unlink
End If
Next
Set oField = Nothing
End Sub

Could you help me a little more, please?

Thanks again



  #9  
Old December 2nd, 2009, 09:02 PM posted to microsoft.public.word.newusers
geotso[_2_]
external usenet poster
 
Posts: 56
Default Custom icons


Your macro in Normal.dotm needs the control passed as an argument:

Problem solved that way!
Thank you Greg; and for the sample script, too!
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.