どのように私はPowerPoint 2007でスライドにドキュメントプロパティ(例えば、著者名)を挿入することができますか?私はこれがMicrosoft Wordで行うことができることを知っていますが、私はそれをPowerPointで行う方法を見つけることができません
(ドキュメントプロパティを使えば、マスターページを使い分けていても、すべてのスライドのフッターの内容などを簡単に変更できるという考えです。別の解決策があれば、それもいいでしょう)
35 None 2010-05-17
Wordはこれを行うことができますが、PowerPointはできません。AFAIKでは、PPTでドキュメントのプロパティを持つことができますが、スライドに挿入することはできません。PowerPointで利用できる唯一の更新フィールドは、日付とスライド番号です。いずれにしても、これを実現するためにVBAで何らかの回避策があるかもしれません。これはStackoverflowで聞いてみるとチャンスがあります
22 Mehper C. Palavuzlar 2010-05-17
すべてのスライドのタグ付きテキストオブジェクトに名前付きプロパティを入れるサブルーチンを書いただけです
スライドの上にファイルのプロパティを置くには。文字列を保持するためにテキストボックスを作成します。プロパティ/Altテキストでプロパティ名を角括弧に入れます
そして、マクロupdateProperties()を実行します
すなわち、[title] – 文書タイトルを複数の文書で更新できるようにします
2つの特別なタグが書かれています。
[copyright]は著作権文字列、すなわち© 1998-2013 P.Boothroyd, NIS Oskemenを挿入します
' Copy document properties into all slides
' (c) 2013, P.Boothroyd for NIS Oskemen
Dim processPage As Slide
Sub updateProperties()
Dim page As Slide
Dim propname As String
' parse all slides in the active presentation (document)
For Each processPage In Application.ActivePresentation.Slides
' scan all elements of page for textbox with tagged "altText/title" field with "["
For Each obj In processPage.Shapes
If Left(obj.Title, 1) = "[" Then
Dim sStart, sEnd As Integer
' extract property from between square brackets
sStart = 2
sEnd = InStr(2, obj.Title, "]")
propname = Trim(Mid(obj.Title, sStart, sEnd - 2))
If obj.Type = msoTextBox Then
' set the text box to the requested value
obj.TextFrame.TextRange.Text = getProperty(propname, obj.TextFrame.TextRange.Text)
End If
End If
Next ' obj
Next ' page
End Sub
' get the named document property (with optional default)
Function getProperty(propname, Optional def As String) As String
' property assigned the default value
getProperty = def
Dim found As Boolean
found = False
propname = LCase(propname)
' copyright is a generated property
If propname = "copyright" Then
Dim author As String
Dim company As String
Dim yearFrom As String
Dim yearTo As String
' get all appropriate variables
author = getProperty("author", "")
company = getProperty("company", "")
yearFrom = getProperty("created", "")
yearTo = Format(Now(), "YYYY")
' insert copyright symbol
getProperty = Chr(169) + " "
' attach year span for copyright notice
If yearFrom yearTo Then
getProperty = getProperty + yearFrom + "-"
End If
getProperty = getProperty + yearTo
' add the author
getProperty = getProperty + " " + author
' add separator for author/company if both exist
If Len(author) > 0 And Len(company) > 0 Then
getProperty = getProperty & ", "
End If
getProperty = getProperty & company
' processed, so return the value
found = True
End If
' insert the slide number into the document
If propname = "page" Then
getProperty = processPage.SlideNumber
found = True
End If
' if generated name created return the value
If found Then GoTo ret
' scan for standard MS (file) properties of the named value
For Each p In Application.ActivePresentation.BuiltInDocumentProperties
If LCase(p.Name) = propname Then
getProperty = p.Value
found = True
Exit For
End If
Next ' p
' scan for customised properties of the named value
If found Then GoTo ret
For Each p In Application.ActivePresentation.CustomDocumentProperties
If LCase(p.Name) = propname Then
getProperty = p.Value
found = True
Exit For
End If
Next ' p
ret:
End Function
6 P.Boothroyd 2013-08-28
回避策は、簡単に「行く」ことができるカスタムプロパティを使用することです(スライドをかき分ける必要はありません)
http://msdn.itags.org/powerpoint/4426/ から
- ブックマークに設定したい図形やテキストを選択します
- ファイル] > [プロパティ] を選択し、[カスタム] タブを有効にします
- しおりの名前を入力します
- コンテンツへのリンク」にチェックを入れます。コンテンツへのリンク」にチェックを入れたときに隣接するドロップダウンボックスに表示される値は、選択した内容への参照です
- Click Add.
- OKをクリックしてプロパティダイアログを閉じます
ブックマークを作成したので、以下のようにジャンプしてみましょう。 1.1. [編集] > [プロパティを開く] を選択します。ダイアログからプロパティ名をクリックします(これはブックマークに付けた名前です)。 3.Go toをクリックします
Go To” ダイアログでは、ダブルクリックしたブックマークのリストが表示され、お気に入りのテキストボックスに移動し、編集/貼り付けの準備ができています
1 thenonhacker 2011-11-29
パワーポイントでこれを行うための最も簡単な方法は、(少なくともすべてのスライドに表示されます値のために)スライドマスターを編集することです。そこに著者名を入れてください
(Wordがあなたに許可しているのに、他の誰にも許可していない理由として考えられるのは、Microsoftの様々なチームが滅多にお互いに話をしないからです…)
1 Tor Iver Wilhelmsen 2012-06-12
ppt 2019でハンドルコードの更新:私は少しのために次のルーチンを変更し、原因は、フロントエンドユーザーがマウスの右ボタンで “alternativetext “を変更することが容易であるということです
For Each ShapeObj In processPage.Shapes
If Left(ShapeObj.AlternativeText, 1) = "[" Then
'If Left(ShapeObj.Title, 1) = "[" Then
Dim sStart, sEnd As Integer
' extract property from between square brackets
sStart = 2
'sEnd = InStr(2, ShapeObj.Title, "]")
sEnd = InStr(2, ShapeObj.AlternativeText, "]")
'propname = Trim(Mid(ShapeObj.Title, sStart, sEnd - 2))
propname = Trim(Mid(ShapeObj.AlternativeText, sStart, sEnd - 2))
ShapeObj.TextFrame.TextRange.Text = getProperty(propname, ShapeObj.TextFrame.TextRange.Text)
End If
Next ' obj
1 Patric Tilge 2019-04-29
私のユースケースに対応するように、自分でサブルーチンを少し更新しました。同じテキストボックスに複数のカスタムプロパティを挿入する必要があり、プロパティごとに1つのテキストボックスではうまくいきませんでした。もし誰かが必要ならば、私の更新したコードを以下に示します
Sub updateProperties()
Dim page As Slide
Dim propname, propvalue As String
' parse all slides in the active presentation (document)
For Each processPage In Application.ActivePresentation.Slides
' scan all elements of page for textbox with tagged "altText/title" field with "[CustomProperty]"
For Each ShapeObj In processPage.Shapes
If ShapeObj.AlternativeText = "[CustomProperty]" Then
Dim sStart, sEnd, test As Integer
Dim before, after As String
sStart = 1
Do While True
' Look for properties in text
sStart = InStr(sStart, ShapeObj.TextFrame.TextRange.Text, "[")
' Exit loop when no more properties
If sStart = 0 Then
Exit Do
End If
sEnd = InStr(sStart, ShapeObj.TextFrame.TextRange.Text, "]")
' If there is no end, then exit loop
If sEnd = 0 Then
Exit Do
End If
' Save text before and after property
before = Mid(ShapeObj.TextFrame.TextRange.Text, 1, sStart - 1)
after = Mid(ShapeObj.TextFrame.TextRange.Text, sEnd + 1)
' Get property name
propname = Mid(ShapeObj.TextFrame.TextRange.Text, sStart + 1, sEnd - sStart - 1)
' Retrieve the value if it exists
propvalue = getProperty(propname)
' If property doesn't exist or we increment sStart to skip this property on next loop
If propvalue = "" Then
sStart = sStart + 1
Else
' Replace text
ShapeObj.TextFrame.TextRange.Text = before + getProperty(propname, ShapeObj.TextFrame.TextRange.Text) + after
End If
Loop
End If
Next ' obj
Next ' page
End Sub
使用するには、AltTextを”[CustomProperty]”に変更すると、テキストボックス内のすべての[プロパティ]をその値に置き換えます
これは正規表現を使った方がいいかもしれません
0 Scaum 2020-02-13

