Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro toolbar to insert graphics in Word

Status
Not open for further replies.

nikka

Instructor
Mar 11, 2001
36
0
0
ZA
I have several graphics that I use frequently and would like to design a macro that can insert these graphics for me with a click of a button, as I require them.

Thanks
 
Have you tried the macro recorder ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
You can use microsoft graph editor in work linking data from excel.. here you find a piece of the Word Help:
----------------------
Link to data in another program to create a chart
Microsoft Graph will update the chart when the data in the source program changes.

In the source program and document, select the data you want to link to the Microsoft Graph datasheet. For example, if you are working on a Microsoft Excel worksheet, select a range of cells.


On the program's Edit menu, click Copy.


Switch to Microsoft Graph, or double-click the Microsoft Graph chart in Word.


Switch to the datasheet.
How?

On the Edit menu, click Paste Link, and then click OK.
----------------------

hope this helps.
A
 
Or...

make the graph in excel, then "Copy" to clipboard.

In word you do:

paste special -> Paste Link -> Microsoft Excel Chart Object

whenever you change the data in excel with excel and word open you'll have the graph in excel (and his copy in word) updated.

hope this will help.
A
 
As I believe you are asking about graphics (as in bitmap images rather than graphs, as in data), PHV has the best suggestion. Unless I am wrong, and you really are talking about graphs.

Record a macro to insert a graphic.

Take a good look at the code. If you have problems with this, post back here.

You can add any macro to any toolbar, as a button. Type in "add a macro button to a toolbar" in Help. It seems a bit daunting at first, but actually it is easy. If you have real problems, post back here.

You can also add macros to menus. You could add a "Insert Graphic" menu to a toolbar, and under that menu have a dropdown list of all the graphics you want to insert. Each menu items would fire a macro that would insert the graphic.

What you are asking for is not difficult. Try recording one macro, dragging it up as a button to a toolbar, or putting it as a menu item - just to see how it works.

Again, if you have a specific difficulty, post back.

Gerry
 
I have a follow-up question to this thread. What about once you have created the macro toolbar button and when the graphic inserts, it is not in a mode where it can be dragged into place? I tried to record while I chose to format the picture and went to the layout tab to choose in front of text, but in record mode that option is grayed out on the layout tab. How would I do this in code? I am a beginner, so thanks in advance for any insight.

[ponder]

 
It really depends on exactly how you are doing the insert.

Time to post code.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top