Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Macro - Organisation chart
Hi... I'm trying to create a Macro in Word 2002, to open the Organisation
chart dialog box. While recording the macro, I click Insert/Organisation chart, the dialog box doesn't open and the macro just waits for my next instruction. Does anyone know why the macro won't open the Org chart dialog box? And for those who are into VB & recording of Macros, can you suggest a good site for information on what the Macro recorder won't record?... (ie I haven't been able to record copying data from Word and exporting to Excel) Thank you! |
#2
|
|||
|
|||
G'day "Vicki" ,
Once you get into writing VBA rather than creating terrible code with the recorder, you never go back. The recorder does things from a users POV, but stops where interactive dialogs or wizards have backing functions that haven't been exposed and cannot be thusly created. Sometimes you can feed key strokes into the buffer with vba's sendkeys func and display the dialog using the Dialogs() object but not always. In the case of an org chart, I would tend to work with a pre-existing chart, rather than rebuild from scratch. With a pre-existing chart, I can look at the shapes collection and modify accordingly. I have no experience with this object though, so I am unsure if it is possible. To test, create a doc with a single org chart in it and nothing else. Flip over into the VBE (Alt+F11) and enter this into the Immediate Window (Ctrl+G) ? ActiveDocument.Shapes.Count ? ActiveDocument.ShapeRanges.Count If either is 0 then we have a 'simple' means of addressing the chart. Steve Hudson - Word Heretic steve from wordheretic.com (Email replies require payment) Without prejudice Vicki reckoned: Hi... I'm trying to create a Macro in Word 2002, to open the Organisation chart dialog box. While recording the macro, I click Insert/Organisation chart, the dialog box doesn't open and the macro just waits for my next instruction. Does anyone know why the macro won't open the Org chart dialog box? And for those who are into VB & recording of Macros, can you suggest a good site for information on what the Macro recorder won't record?... (ie I haven't been able to record copying data from Word and exporting to Excel) Thank you! |
#3
|
|||
|
|||
Hi Steve
Thank you for your response, I'll use your tip and go with using a pre-existing chart. As I'm not strong on my VBA knowledge, this will be easier for me. Speaking of VBA code, do you have any tips on how I could quickly grasp the basics of this code? I train Word XP Advanced but my knowledge stops when it comes to stepping into the Macro code. cheers Vicki "Word Heretic" wrote: G'day "Vicki" , Once you get into writing VBA rather than creating terrible code with the recorder, you never go back. The recorder does things from a users POV, but stops where interactive dialogs or wizards have backing functions that haven't been exposed and cannot be thusly created. Sometimes you can feed key strokes into the buffer with vba's sendkeys func and display the dialog using the Dialogs() object but not always. In the case of an org chart, I would tend to work with a pre-existing chart, rather than rebuild from scratch. With a pre-existing chart, I can look at the shapes collection and modify accordingly. I have no experience with this object though, so I am unsure if it is possible. To test, create a doc with a single org chart in it and nothing else. Flip over into the VBE (Alt+F11) and enter this into the Immediate Window (Ctrl+G) ? ActiveDocument.Shapes.Count ? ActiveDocument.ShapeRanges.Count If either is 0 then we have a 'simple' means of addressing the chart. Steve Hudson - Word Heretic steve from wordheretic.com (Email replies require payment) Without prejudice Vicki reckoned: Hi... I'm trying to create a Macro in Word 2002, to open the Organisation chart dialog box. While recording the macro, I click Insert/Organisation chart, the dialog box doesn't open and the macro just waits for my next instruction. Does anyone know why the macro won't open the Org chart dialog box? And for those who are into VB & recording of Macros, can you suggest a good site for information on what the Macro recorder won't record?... (ie I haven't been able to record copying data from Word and exporting to Excel) Thank you! |
#4
|
|||
|
|||
G'day "Vicki" ,
I found the best way was to use the object explorer (F2) from inside the VBE (Alt+F11). Start with high level objects like Document, Application and System and check out what hangs under them. Steve Hudson - Word Heretic steve from wordheretic.com (Email replies require payment) Without prejudice Vicki reckoned: Hi Steve Thank you for your response, I'll use your tip and go with using a pre-existing chart. As I'm not strong on my VBA knowledge, this will be easier for me. Speaking of VBA code, do you have any tips on how I could quickly grasp the basics of this code? I train Word XP Advanced but my knowledge stops when it comes to stepping into the Macro code. cheers Vicki "Word Heretic" wrote: G'day "Vicki" , Once you get into writing VBA rather than creating terrible code with the recorder, you never go back. The recorder does things from a users POV, but stops where interactive dialogs or wizards have backing functions that haven't been exposed and cannot be thusly created. Sometimes you can feed key strokes into the buffer with vba's sendkeys func and display the dialog using the Dialogs() object but not always. In the case of an org chart, I would tend to work with a pre-existing chart, rather than rebuild from scratch. With a pre-existing chart, I can look at the shapes collection and modify accordingly. I have no experience with this object though, so I am unsure if it is possible. To test, create a doc with a single org chart in it and nothing else. Flip over into the VBE (Alt+F11) and enter this into the Immediate Window (Ctrl+G) ? ActiveDocument.Shapes.Count ? ActiveDocument.ShapeRanges.Count If either is 0 then we have a 'simple' means of addressing the chart. Steve Hudson - Word Heretic steve from wordheretic.com (Email replies require payment) Without prejudice Vicki reckoned: Hi... I'm trying to create a Macro in Word 2002, to open the Organisation chart dialog box. While recording the macro, I click Insert/Organisation chart, the dialog box doesn't open and the macro just waits for my next instruction. Does anyone know why the macro won't open the Org chart dialog box? And for those who are into VB & recording of Macros, can you suggest a good site for information on what the Macro recorder won't record?... (ie I haven't been able to record copying data from Word and exporting to Excel) Thank you! |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I edit an organisation chart in Word 97? | Microsoft Word Help | |||
Formatting of Text in Chart | Microsoft Word Help | |||
Edit an organisation chart without re-formatting into VBA color-f. | Microsoft Word Help | |||
2000 to 2002 macro and "Could not open macro storage" | Mailmerge | |||
inserting pictures on an organisation chart | Mailmerge |