Help us understand the problem. What is going on with this article?

パワポでズンドコキヨシ

More than 3 years have passed since last update.

「ズン」と「ドコ」のスライドを追加していって、例のパターンが発生したら「キ・ヨ・シ!」で終わるスライドを自動で作ります。生成されたスライドはリズムに乗ってめくっていくなどすると盛り上がると思います。

  1. PowerPointのオプションのリボンの設定で「開発」リボンを有効にします
  2. 「開発」リボンの「Visual Basic」をクリックしてVisual Basic Editorを開きます
  3. Visual Basic Editor左側の「VBAProject」を右クリックして「挿入→標準モジュール」を選択します
  4. 作成されたモジュールの中に以下のコードをペーストします
  5. コード中のSub ZunDokoKiyosi()の行を選択してツールバーの実行ボタンを押します。
Sub ZunDokoKiyosi()
    Do While ActivePresentation.Slides.Count > 0
        ActivePresentation.Slides.Item(1).Delete
    Loop

    `パターン判定はC言語版のNLZ(number of leading ZUN)方式を拝借
    Dim nlz As Integer
    Dim c As Integer

    nlz = 0
    c = 0

    Do
        nlz = IIf(c = 1, nlz + 1, 0)
        c = Int(Rnd * 2)
        AddSlide IIf(c = 1, "ズン", "ドコ")
    Loop While nlz < 4 Or c = 1

    AddSlide "キ・ヨ・シ!"
End Sub

Function AddSlide(text As String)
    Dim p As Presentation
    Dim slide As slide
    Dim textBox As Shape

    Set p = ActivePresentation
    Set slide = p.Slides.Add(p.Slides.Count + 1, Layout:=ppLayoutBlank)

    Set textBox = slide.Shapes.AddTextbox(msoTextOrientationHorizontal, 0, 0, 0, 0)

    With textBox
        .TextFrame.TextRange = text
        .TextFrame.TextRange.ParagraphFormat.Alignment = ppAlignCenter
        .TextFrame.VerticalAnchor = msoAnchorMiddle
        .TextFrame.AutoSize = ppAutoSizeNone
        .Width = p.PageSetup.SlideWidth
        .Height = p.PageSetup.SlideHeight
        .TextEffect.FontSize = 200
    End With

    ActiveWindow.View.GotoSlide slide.SlideIndex
End Function

pp-zun-doko-kiyoshi.gif

rryu
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした