Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
OrganizationEventAdvent CalendarQiitadon (β)
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What are the problem?

More than 5 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

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

    nlz = 0
    c = 0

        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


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
Help us understand the problem. What are the problem?