Word form in PPT (2000) - navigation and macro problems

H

Hilary Ostrov

As a corporate standard, a client has elected to use Powerpoint for
all internal presentations. Because one of these "presentations"
contains a number of (what in a Word form would be) textform fields, I
have been asked to devise a template which will make PPT perform more
like Word - for users who are not techno-savvy and who are (very
understandably, IMHO) resistant to using the existing .pot to enter
the appropriate information into numerous basic ppt textboxes.

Towards this end, I am currently testing the use of a fairly simple
Word form inserted as an object. Form contains dropdowns and fill-ins
enabled contained in a table. It works fine ... text and date formats
appear as expected on exit from each field. BUT navigation within the
form object is not as user friendly as in the original Word doc: tab,
backspace, delete and cursor keys do not seem to work :(

Also in the test doc, I have three checkboxes within a Frame with
simple macro to make sure only one of three boxes is checked. Macro
code works fine in Word, but ppt doesn't like it ... tells me cmd is
not available:( Here's the code:

===
Sub MakeCheckBoxesExclusive()

Dim oField As FormField

For Each oField In Selection.Frames(1).Range.FormFields
oField.CheckBox.Value = False
Next oField

Selection.FormFields(1).CheckBox.Value = True

End Sub
===

What do I need to do to regain navigation and macro functionality -
other than inserting object as link so that editing is done in Word
rather than PPT? If the latter is the preferred option, what code
would I use to ensure that each new "presentation" starts with a new
doc in Word? (Tried linking to .dot rather than to .doc hoping it
would create a new .doc based on .dot, but it doesn't)

Or is there a better way to accomplish what I'm trying to do?! One
further question: I am creating this in Office 2000, and most users
are on Office 2003. Are there any issues/glitches I should be aware
of - and/or are there any additional features in PPT 2003 which would
overcome the problems I've identified above?

TIA for any assistance and enlightenment.

hro
hro
 
S

Steve Rindsberg

Can you bring up a user form with the needed controls rather than putting them
on the slide directly?

I can almost promise you a longer, happier life if so.

As to the code, PPT's object model is quite different from Word's, so code that
references the OM as specifically as yours won't work:
===
Sub MakeCheckBoxesExclusive()
Dim oField As FormField

PPT doesn't have a FormField data type - that won't fly.
For Each oField In Selection.Frames(1).Range.FormFields

A selection in PPT doesn't have .Frames so that hasn't wings either.
oField.CheckBox.Value = False
Next oField

Selection.FormFields(1).CheckBox.Value = True

Selection doesn't have a .FormFields collection
 
H

Hilary Ostrov

Can you bring up a user form with the needed controls rather than putting them
on the slide directly?

I can almost promise you a longer, happier life if so.

No doubt! Thanks for the suggestion, Steve, but I need to build this
template bearing in mind that while change is a constant in the
client's corporate environment, client does not want to be dependent
on outside help to make any modifications to (for example) choices in
drop-downs.

I did take a look at PPT's user form and I doubt that this would meet
client's criteria. Add to this your info below regarding PPT's object
model, and it seems I'd have to learn a whole new language before I
could create a suitable template! My guess is that VB (with which I
am at least somewhat familiar through work in MS Access) doesn't work
with PPT either - or does it?!
As to the code, PPT's object model is quite different from Word's, so code that
references the OM as specifically as yours won't work:


PPT doesn't have a FormField data type - that won't fly.

Well, that explains that mystery! I think client can live without the
mutually exclusive checkboxes. I was actually trying this only to see
how macros developed in Word will behave when Word doc is dropped into
ppt, because there are certain fields that the client wants to make
mandatory, and I know I'll have to do this with code.

What you seem to be saying is that PPT will respect whatever code is
behind the native formfield properties, but not any user defined macro
code.

Since your suggested user form is probably not a viable option, could
you point me in the direction of some code I can use in a .pot which
will ensure that a Word object linked to a Word.dot will generate a
new Word.doc for each new .ppt?

Or is there some workaround code to achieve the same goal, i.e. each
new .ppt created from this .pot will be linked to its very own .doc?
(Actually, there'll be considerably more than one linked .doc, but if
I can get it to work with one .doc in one slide, I'm hoping it will
work with multiple .doc's in respective multiple slides!)

[...]

Thanks, again :)
hro
 
S

Steve Rindsberg

Can you bring up a user form with the needed controls rather than putting them
No doubt! Thanks for the suggestion, Steve, but I need to build this
template bearing in mind that while change is a constant in the
client's corporate environment, client does not want to be dependent
on outside help to make any modifications to (for example) choices in
drop-downs.

No need for outside help. The code can read choices from a text or ini file and
populate the listbox from that.
I did take a look at PPT's user form and I doubt that this would meet
client's criteria. Add to this your info below regarding PPT's object
model, and it seems I'd have to learn a whole new language before I
could create a suitable template!

Ah, now there's a Word-ism that won't fly in PPT either. You're probably
accustomed to distributing solutions that include VBA as word templates.

PowerPoint templates can contain code, but it won't run automatically, so there's
seldom any reason to distribute VBA solutions that way. Or much use in doing so.

Usually you need to distribute an Add-in (possibly in conjunction with a template)
My guess is that VB (with which I
am at least somewhat familiar through work in MS Access) doesn't work
with PPT either - or does it?!

You can write standalone apps (ie, EXEs) in VB5/6/.Net that drive PPT, certainly.
Or you can automate it from Access or Word if that fits your needs.
What you seem to be saying is that PPT will respect whatever code is
behind the native formfield properties, but not any user defined macro
code.

You're speaking Word here, I think. PPT doesn't have formfields.
Since your suggested user form is probably not a viable option, could
you point me in the direction of some code I can use in a .pot which
will ensure that a Word object linked to a Word.dot will generate a
new Word.doc for each new .ppt?

See above ... code in a POT will not do you any good.

Have a look at http://www.pptfaq.com -- the VBA programming section, and especially
the parts about creating PPA (ie, add-ins).

Have a look also at the FAQ about making PPT respond to events. You'll probably
need to set up an event handler to respond to new presentations being created.
Or is there some workaround code to achieve the same goal, i.e. each
new .ppt created from this .pot will be linked to its very own .doc?
(Actually, there'll be considerably more than one linked .doc, but if
I can get it to work with one .doc in one slide, I'm hoping it will
work with multiple .doc's in respective multiple slides!)

[...]

Thanks, again :)
hro
 
H

Hilary Ostrov

No need for outside help. The code can read choices from a text or ini file and
populate the listbox from that.

Actually, I've solved the problem ... quite elegantly, I think ;) All
I needed to do - after I fathomed the mysteries and counterintuitive
idiosyncracies of Slide Master/Title Master - was figure out how ppt
interprets Word styles, apply them appropriately to my Word form
template, and add a marvellous macro to unlink fields (which runs on
exiting the last field in my form).

This changes all formfield data to text, giving me a nice outline that
will keep PPT happy! Then I use File->Send to->Powerpoint, apply my
design .pot to the slides and change the layout of the first slide to
Title (and others accordingly, of course). Takes less than ten
seconds for two slides - and works like a charm!

The one somewhat puzzling <aggrannoyance> is that if I go the
preferred route, i.e. by starting with the correct .pot then adding
slides from outline, text that was bold in the .doc is now regular,
and that which was regular is bold! What am I doing wrong?! If it's
not me, I know how to compensate for it, but will the same behaviour
occur in PPT 2003?

[...]

Thanks!
hro
 
S

Steve Rindsberg

The one somewhat puzzling said:
preferred route, i.e. by starting with the correct .pot then adding
slides from outline, text that was bold in the .doc is now regular,
and that which was regular is bold! What am I doing wrong?! If it's
not me, I know how to compensate for it, but will the same behaviour
occur in PPT 2003?

It seems so. That is, I got the same result when saving from Word 2002 and inserting
into PPT 2002 and 2003.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top