Want a macro to open the Properties Dialog Box and enter text

J

Jessica Dubey

I want to be able to open the Properties Dialog and then enter
information into it, without having to retype or copy and paste each
time. Is this doable with VBA macros?

-Jessica
 
J

John Wilson

Which version?

Jessica Dubey said:
I want to be able to open the Properties Dialog and then enter
information into it, without having to retype or copy and paste each
time. Is this doable with VBA macros?

-Jessica

__________ Information from ESET Smart Security, version of virus
signature database 5002 (20100405) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 5002 (20100405) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
J

Jessica Dubey

I want to be able to open the Properties Dialog and then enter
information into it, without having to retype or copy and paste each
time. Is this doable with VBA macros?

-Jessica

Oh yes, PowerPoint 2007 and 2010
 
S

Shyam Pillai

Hello Jessica,
Is the information going to be the same in the all the cases? If yes, then
you don't need to open the properties dialog, you can just run the code to
populate the field with values you set.

Regards,
Shyam Pillai

Image Importer Wizard: http://skp.mvps.org/iiw.htm
 
J

JessicaD

So how do I even code that? I'm very new to this. I've found the basic
information, but I don't know how to find, for instance, the object that is
the Properties Dialog Box field.
 
S

Shyam Pillai

Hi,

Enumerate all the builtin document properties:

Dim dp As DocumentProperty

'I've used on error resume next since there will be some properties where
' Value property will fail when there are not set.
' For example if the presentation has never been printed then 'Last print
date ' will fail.

On Error Resume Next
For Each dp In Application.ActivePresentation.BuiltInDocumentProperties
Debug.Print dp.Name & ": ",
Debug.Print dp.Value
Debug.Print
Next

The builtin document properties can be accessed by name or by index.

With ActivePresentation.BuiltInDocumentProperties
.Item(Index:=1).Value = "My Title"
.Item(Index:=3).Value = "Shyam Pillai"
End With

this is equivalent to:

With Application.ActivePresentation.BuiltInDocumentProperties
.Item("title").Value = "My Title"
.Item("author").Value = "Shyam Pillai"
End with

You can add your own custom properties:

With ActivePresentation
Call .CustomDocumentProperties.Add(Name:="MyCustomPropery", _
LinkToContent:=msoFalse, _
Type:=msoPropertyTypeString, _
Value:="TheValue")
End With

These will appear on the File Properties | Custom tab.

Regards,
Shyam Pillai

Image Importer Wizard: http://skp.mvps.org/iiw.htm
 

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