> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brandfetch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Brandfetch with Microsoft PowerPoint

Microsoft PowerPoint has no `IMAGE` function like Sheets or Microsoft Excel, so logos go in as static pictures. For a single slide, paste a Brandfetch URL directly into the picture dialog. For a whole deck, VBA's `Shapes.AddPicture` accepts a Brandfetch URL too, so a short macro can drop dozens of logos in one run instead of pasting each one by hand.

## Quick manual insert

<Steps>
  <Step title="Build the logo URL">
    Use a high resolution so the logo stays sharp if it's resized on the slide:

    ```
    https://cdn.brandfetch.io/nike.com/w/512/h/512?c=BRANDFETCH_CLIENT_ID
    ```
  </Step>

  <Step title="Insert it as a picture">
    In Microsoft PowerPoint for Windows, go to **Insert > Pictures > This Device**, then paste the URL into the filename field instead of picking a local file, and click **Insert**.

    <Note>
      The picture dialogs in Microsoft PowerPoint for Mac and Microsoft PowerPoint for web don't accept URLs. Download the image in your browser first, then insert it from disk.
    </Note>
  </Step>

  <Step title="Reuse it across the deck">
    To keep a logo consistent across every slide in a layout, add it to the **Slide Master** (**View > Slide Master**) once instead of pasting it slide by slide.
  </Step>
</Steps>

## Macros: insert logos in bulk

`Shapes.AddPicture` is documented as taking a local file path, but current Microsoft 365 desktop builds also accept an `http`/`https` URL directly in that argument and fetch it on the spot, no download-then-insert step needed. That makes it a drop-in replacement for the CDN URL used above, looped over as many logos as you need. Both macros below request the `icon.png` variant rather than Brandfetch's WebP default, since `AddPicture` inserts PNG reliably across Office versions.

<Note>
  Macros need Microsoft PowerPoint desktop; they don't run in Microsoft PowerPoint for web. Save the file as a macro-enabled presentation (`.pptm`) and allow macros when you reopen it. If `AddPicture` raises error 1004 ("The specified file was not found"), your build doesn't fetch URLs, download the logo files first and pass local paths instead.
</Note>

### Build a logo wall

Drops a grid of logos onto the current slide from a list of domains, useful for a "trusted by" or portfolio slide. Each inserted picture is tagged with the domain in its **Alt Text**, so the refresh macro below can find it again later.

```vb Insert Logo Wall theme={null}
Sub InsertLogoWall()
    Dim domains As Variant
    domains = Array("nike.com", "airbnb.com", "slack.com", "notion.so", "figma.com", "linear.app")

    Dim clientId As String
    clientId = "BRANDFETCH_CLIENT_ID"

    Dim sld As Slide
    Set sld = ActiveWindow.View.Slide

    Dim cols As Integer, logoSize As Single, gap As Single
    cols = 3
    logoSize = 90
    gap = 24

    Dim i As Integer, col As Integer, row As Integer
    Dim domain As String, url As String, pic As Shape

    For i = 0 To UBound(domains)
        domain = domains(i)
        url = "https://cdn.brandfetch.io/" & domain & "/w/256/h/256/icon.png?c=" & clientId

        col = i Mod cols
        row = i \ cols

        Set pic = sld.Shapes.AddPicture(FileName:=url, LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, _
            Left:=40 + col * (logoSize + gap), Top:=100 + row * (logoSize + gap), _
            Width:=logoSize, Height:=logoSize)
        pic.AlternativeText = "brandfetch:" & domain
    Next i
End Sub
```

### Refresh every logo in a deck

Rerun this any time to swap in fresh logos across every slide at once, for example after a client rebrand, or to bump resolution before a deck goes to print. It finds every picture tagged by the macro above, re-fetches it at the shape's current size and position, and replaces it in place.

```vb Refresh All Logos theme={null}
Sub RefreshAllLogos()
    Dim clientId As String
    clientId = "BRANDFETCH_CLIENT_ID"

    Dim sld As Slide, shp As Shape, newShp As Shape
    Dim i As Integer, domain As String

    For Each sld In ActivePresentation.Slides
        For i = sld.Shapes.Count To 1 Step -1
            Set shp = sld.Shapes(i)
            If shp.Type = msoPicture And Left(shp.AlternativeText, 11) = "brandfetch:" Then
                domain = Mid(shp.AlternativeText, 12)

                Set newShp = sld.Shapes.AddPicture(FileName:="https://cdn.brandfetch.io/" & domain & "/w/512/h/512/icon.png?c=" & clientId, _
                    LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, _
                    Left:=shp.Left, Top:=shp.Top, Width:=shp.Width, Height:=shp.Height)
                newShp.AlternativeText = shp.AlternativeText

                shp.Delete
            End If
        Next i
    Next sld
End Sub
```

### Running a macro

<Steps>
  <Step title="Open the VBA editor">
    Press **Alt+F11** (Windows) or **Fn+Option+F11** (Mac), then **Insert > Module** and paste one of the macros above.
  </Step>

  <Step title="Run it">
    With a slide open in Normal view, press **F5** or **Run > Run Sub/UserForm**.
  </Step>

  <Step title="Save as macro-enabled">
    Save the deck as **PowerPoint Macro-Enabled Presentation (.pptm)** so the macros are kept for next time.
  </Step>
</Steps>

## Access all brand data (logos, colors, company data...)

Logos are only half of an on-brand deck, the other half is the brand's colors. Those come from the [Brand API](/brand-api/overview), which returns each brand's color palette, fonts, and company info as JSON. You'll need a Brand API key from the [API keys page](https://developers.brandfetch.com/dashboard/keys), this is a secret key, separate from the client ID used above.

This macro fetches a brand's accent color and draws a color bar across the bottom of every slide:

```vb Apply Brand Accent theme={null}
Sub ApplyBrandAccent()
    Dim apiKey As String, domain As String
    apiKey = "YOUR_BRAND_API_KEY"
    domain = "nike.com"

    Dim http As Object
    Set http = CreateObject("MSXML2.XMLHTTP")
    http.Open "GET", "https://api.brandfetch.io/v2/brands/domain/" & domain, False
    http.setRequestHeader "Authorization", "Bearer " & apiKey
    http.Send

    If http.Status <> 200 Then
        MsgBox "Brand API returned status " & http.Status
        Exit Sub
    End If

    ' pull the accent color's hex code out of the JSON
    Dim re As Object, matches As Object
    Set re = CreateObject("VBScript.RegExp")
    re.Pattern = "\{[^{}]*""type""\s*:\s*""accent""[^{}]*\}"
    Set matches = re.Execute(http.responseText)
    If matches.Count = 0 Then
        MsgBox "No accent color found for " & domain
        Exit Sub
    End If

    re.Pattern = "#[0-9A-Fa-f]{6}"
    Dim hexColor As String
    hexColor = re.Execute(matches(0).Value)(0).Value

    Dim accentRGB As Long
    accentRGB = RGB(CLng("&H" & Mid(hexColor, 2, 2)), _
                    CLng("&H" & Mid(hexColor, 4, 2)), _
                    CLng("&H" & Mid(hexColor, 6, 2)))

    Dim sld As Slide, bar As Shape
    For Each sld In ActivePresentation.Slides
        Set bar = sld.Shapes.AddShape(msoShapeRectangle, _
            0, ActivePresentation.PageSetup.SlideHeight - 8, _
            ActivePresentation.PageSetup.SlideWidth, 8)
        bar.Fill.ForeColor.RGB = accentRGB
        bar.Line.Visible = msoFalse
    Next sld
End Sub
```

The same response carries the full palette (`colors`), the brand's fonts, and company data, so the pattern extends to title colors, themed shapes, or a closing slide with company facts. Each run counts against your Brand API plan's quota.

<Note>
  `MSXML2.XMLHTTP` (the HTTP client used here) is Windows-only, so this macro doesn't run on Microsoft PowerPoint for Mac. On a Mac, fetch the JSON once with `curl` in Terminal and hardcode the hex value instead.
</Note>

<Warning>
  Brand API keys are secret. A macro embeds the key in the presentation file, so strip it before sharing the deck outside your team.
</Warning>

## At scale: Macabacus Logo Library

If your team inserts logos into decks constantly (pitch books, client reports), [Macabacus](https://macabacus.com/features/logo-library) partners with Brandfetch to power **Logo Library**, a Microsoft PowerPoint add-in that lets you search and insert from Brandfetch's logo dataset directly inside Microsoft PowerPoint, no URL-pasting required.
