Word Template Image Tags

How to Add Logo, Signature, and Stamp Tags to Word Templates

Build stable image positions in Word, map reviewed logo, signature, and stamp files from Excel, preserve aspect ratio, and verify both DOCX and PDF before releasing the batch.

Stable image tags
Aspect ratio locked
Reviewed DOCX + PDF
Local Word workflow
A signature or stamp image is visual content, not a cryptographic digital signature, identity check, approval record, or proof of legal validity. Keep the required authorization process outside the image-insertion step.

Quick answer: use tags only for images that vary

Keep a logo directly in the Word template when every output uses the same approved file. Use image tags when the logo, signature, or stamp changes by record or case and the source file must be selected from structured data.

Static company logo

Embed it in Word once. A tag adds complexity without changing the result.

Record-specific logo

Map the approved image file to photo_logo when brands or business units vary by row.

Optional signature

Map a reviewed file to photo_signature. A blank value should clear the placeholder, not leave tag text in the document.

Optional stamp

Map a reviewed file to photo_stamp and test transparency, size, and PDF output before release.

Prepare the image assets before editing Word

Image quality depends on the actual pixels, transparency, crop, and Word/PDF rendering. DPI metadata alone does not guarantee a sharp or correctly sized result.

Use approved source files

Keep one controlled Images folder beside the workbook. Do not let rows point to arbitrary folders or network locations.

Prefer transparent PNG

PNG usually works best for signatures and stamps with transparent backgrounds. Use JPG only when transparency is unnecessary.

Crop empty margins

Large transparent borders make an image look too small even when its Word dimensions are correct.

Check real pixel size

Do not enlarge a small raster image. The VBA helper reduces oversized images but never scales a source above 100%.

Keep aspect ratio

Set maximum width and height, then scale proportionally. Avoid assigning both dimensions independently.

Control sensitive assets

Restrict access to signature and stamp files, record who approved them, and remove obsolete assets from the production folder.

Legal boundary

Inserting a scanned signature or stamp does not create a digital signature, verify identity, prove consent, or replace a required signing platform. Treat it as document artwork unless your legal and approval process establishes something more.

Create stable image tags in the Word template

Use Word bookmarks for the VBA workflow. Select the placeholder area, then create bookmarks with the exact names below. Bookmark names are unique, predictable anchors that the macro can verify before inserting files.

photo_logo

Place it inside the header, cover block, or table cell reserved for the logo. The example caps it at 4.5 × 2.0 cm.

photo_signature

Place it inside the signature layout. The example caps it at 5.0 × 2.0 cm and clears the bookmark when the Excel cell is blank.

photo_stamp

Place it inside the stamp layout. The example caps it at 3.5 × 3.5 cm and preserves the original proportions.

Use inline positions

Keep each bookmark in a controlled paragraph or table cell. Inline pictures move with text more predictably than floating shapes.

DocxForge Pro text tags vs. VBA bookmarks

These are two different template methods. For DocxForge Pro, place literal text tags {{photo_logo}}, {{photo_signature}}, and {{photo_stamp}} in the Word template and configure the image references in the relevant module. For the free VBA macro on this page, instead create Word bookmarks named photo_logo, photo_signature, and photo_stamp. The VBA helper looks up bookmarks, not literal {{...}} text, so do not substitute one syntax for the other.

The bookmark approach avoids a general Find operation that might match the wrong text, miss headers or text boxes, or stop at only the first occurrence. It uses Word's Bookmarks.Exists method to verify locations before inserting images.

Define the Excel contract and folders

Save the Excel file as an Excel Macro-Enabled Workbook (.xlsm). Create a sheet named Data and use the exact A–E headers in row 1.

Required columns A–E

A — DocumentID; B — LogoFile; C — SignatureFile; D — StampFile; E — Status.

Required folder layout

Templates\ImageTagTemplate.docx, Images\approved-logo.png, and the workbook at the same root level. Output goes to GeneratedImageDocs.

Logo is required

Every READY row must name one PNG, JPG, or JPEG file in LogoFile.

Signature and stamp are optional

Blank cells clear their bookmarks. A nonblank value must name an existing, nonempty image file.

File names, not paths

Columns B–D accept base file names only. Folder separators, drive prefixes, control characters, and .. are rejected.

Only READY rows run

Other rows remain outside the batch. Use a review step before changing Status to READY.

Free VBA helper: insert reviewed images and keep proportions

The macro validates all READY rows and image files before Word starts. It opens one fresh template per row, inserts embedded inline pictures with maximum dimensions, creates DOCX/PDF in a run-specific temporary folder, and moves the completed pair without overwriting an existing destination.

Option Explicit

Private Const wdFormatXMLDocument As Long = 12
Private Const wdExportFormatPDF As Long = 17
Private Const msoTrue As Long = -1
Private Const FILE_ATTRIBUTES As Long = 7
Private Const FOLDER_ATTRIBUTES As Long = 22

Public Sub GenerateDocumentsWithImageTags()
    Const DATA_SHEET As String = "Data"
    Const TEMPLATE_FILE As String = "ImageTagTemplate.docx"
    Const OUTPUT_FOLDER_NAME As String = "GeneratedImageDocs"

    Dim ws As Worksheet
    Dim lastCell As Range
    Dim data As Variant
    Dim nameKeys As Object
    Dim wdApp As Object
    Dim wdDoc As Object
    Dim templateFolder As String
    Dim templatePath As String
    Dim imagesFolder As String
    Dim outputFolder As String
    Dim runFolder As String
    Dim docxPath As String
    Dim pdfPath As String
    Dim tempDocxPath As String
    Dim tempPdfPath As String
    Dim documentId As String
    Dim logoFile As String
    Dim signatureFile As String
    Dim stampFile As String
    Dim logoPath As String
    Dim signaturePath As String
    Dim stampPath As String
    Dim statusText As String
    Dim baseName As String
    Dim lastRow As Long
    Dim dataRow As Long
    Dim rowNumber As Long
    Dim readyCount As Long
    Dim generatedCount As Long
    Dim currentStep As String
    Dim errorNumber As Long
    Dim errorDescription As String

    On Error GoTo CleanFail

    currentStep = "checking the saved workbook location"
    If Len(ThisWorkbook.Path) = 0 Then
        Err.Raise vbObjectError + 2700, , _
            "Save the macro-enabled workbook before running this macro."
    End If

    currentStep = "building the template, image, and output paths"
    templateFolder = JoinPath(ThisWorkbook.Path, "Templates")
    templatePath = JoinPath(templateFolder, TEMPLATE_FILE)
    imagesFolder = JoinPath(ThisWorkbook.Path, "Images")
    outputFolder = JoinPath(ThisWorkbook.Path, OUTPUT_FOLDER_NAME)

    If Len(Dir$(templatePath, FILE_ATTRIBUTES)) = 0 Then
        Err.Raise vbObjectError + 2701, , _
            "Template not found: " & templatePath
    End If
    If Len(Dir$(imagesFolder, FOLDER_ATTRIBUTES)) = 0 Then
        Err.Raise vbObjectError + 2702, , _
            "Images folder not found: " & imagesFolder
    End If
    If Len(Dir$(outputFolder, FOLDER_ATTRIBUTES)) = 0 Then
        MkDir outputFolder
    End If

    currentStep = "opening the Data worksheet"
    Set ws = ThisWorkbook.Worksheets(DATA_SHEET)
    ValidateHeaders ws

    currentStep = "finding the final data row"
    Set lastCell = ws.Range("A:E").Find( _
        What:="*", _
        After:=ws.Range("A1"), _
        LookIn:=xlFormulas, _
        LookAt:=xlPart, _
        SearchOrder:=xlByRows, _
        SearchDirection:=xlPrevious, _
        MatchCase:=False)
    If lastCell Is Nothing Then
        Err.Raise vbObjectError + 2703, , _
            "No data rows were found on the Data worksheet."
    End If
    If lastCell.Row < 2 Then
        Err.Raise vbObjectError + 2703, , _
            "No data rows were found on the Data worksheet."
    End If
    lastRow = lastCell.Row
    data = ws.Range("A2:E" & lastRow).Value2

    currentStep = "preflighting READY rows and image files"
    Set nameKeys = CreateObject("Scripting.Dictionary")
    nameKeys.CompareMode = vbTextCompare

    For dataRow = 1 To UBound(data, 1)
        rowNumber = dataRow + 1
        statusText = ReadOptionalText(data(dataRow, 5), "E" & rowNumber)

        If StrComp(statusText, "READY", vbTextCompare) = 0 Then
            readyCount = readyCount + 1
            documentId = ReadRequiredText( _
                data(dataRow, 1), "DocumentID", "A" & rowNumber)
            logoFile = ReadRequiredText( _
                data(dataRow, 2), "LogoFile", "B" & rowNumber)
            signatureFile = ReadOptionalText( _
                data(dataRow, 3), "C" & rowNumber)
            stampFile = ReadOptionalText( _
                data(dataRow, 4), "D" & rowNumber)

            logoPath = ResolveImagePath( _
                imagesFolder, logoFile, "B" & rowNumber)
            If Len(signatureFile) > 0 Then
                signaturePath = ResolveImagePath( _
                    imagesFolder, signatureFile, "C" & rowNumber)
            Else
                signaturePath = vbNullString
            End If
            If Len(stampFile) > 0 Then
                stampPath = ResolveImagePath( _
                    imagesFolder, stampFile, "D" & rowNumber)
            Else
                stampPath = vbNullString
            End If

            baseName = "ImageTags_" & CleanFileName(documentId)
            docxPath = JoinPath(outputFolder, baseName & ".docx")
            pdfPath = JoinPath(outputFolder, baseName & ".pdf")

            If nameKeys.Exists(baseName) Then
                Err.Raise vbObjectError + 2704, , _
                    "Duplicate output name after cleaning: " & baseName & _
                    " (Excel row " & rowNumber & ")."
            End If
            nameKeys.Add baseName, rowNumber

            If Len(Dir$(docxPath, FILE_ATTRIBUTES)) > 0 Or _
               Len(Dir$(pdfPath, FILE_ATTRIBUTES)) > 0 Then
                Err.Raise vbObjectError + 2705, , _
                    "Output already exists for Excel row " & _
                    rowNumber & ": " & baseName
            End If
        End If
    Next dataRow

    If readyCount = 0 Then
        Err.Raise vbObjectError + 2706, , _
            "No rows with Status READY were found."
    End If

    currentStep = "creating the run-specific temporary folder"
    runFolder = CreateRunFolder(outputFolder)

    currentStep = "starting Microsoft Word"
    Set wdApp = CreateObject("Word.Application")
    wdApp.Visible = False
    wdApp.ScreenUpdating = False
    wdApp.DisplayAlerts = 0

    For dataRow = 1 To UBound(data, 1)
        rowNumber = dataRow + 1
        statusText = ReadOptionalText(data(dataRow, 5), "E" & rowNumber)

        If StrComp(statusText, "READY", vbTextCompare) = 0 Then
            documentId = ReadRequiredText( _
                data(dataRow, 1), "DocumentID", "A" & rowNumber)
            logoFile = ReadRequiredText( _
                data(dataRow, 2), "LogoFile", "B" & rowNumber)
            signatureFile = ReadOptionalText( _
                data(dataRow, 3), "C" & rowNumber)
            stampFile = ReadOptionalText( _
                data(dataRow, 4), "D" & rowNumber)

            logoPath = ResolveImagePath( _
                imagesFolder, logoFile, "B" & rowNumber)
            If Len(signatureFile) > 0 Then
                signaturePath = ResolveImagePath( _
                    imagesFolder, signatureFile, "C" & rowNumber)
            Else
                signaturePath = vbNullString
            End If
            If Len(stampFile) > 0 Then
                stampPath = ResolveImagePath( _
                    imagesFolder, stampFile, "D" & rowNumber)
            Else
                stampPath = vbNullString
            End If

            baseName = "ImageTags_" & CleanFileName(documentId)
            docxPath = JoinPath(outputFolder, baseName & ".docx")
            pdfPath = JoinPath(outputFolder, baseName & ".pdf")
            tempDocxPath = JoinPath(runFolder, baseName & ".docx")
            tempPdfPath = JoinPath(runFolder, baseName & ".pdf")

            currentStep = "opening the template for Excel row " & rowNumber
            Set wdDoc = wdApp.Documents.Open( _
                templatePath, False, True, False)
            VerifyImageBookmarks wdDoc

            currentStep = "inserting images for Excel row " & rowNumber
            InsertImageAtBookmark wdDoc, "photo_logo", logoPath, _
                CentimetersToPoints(4.5), CentimetersToPoints(2#)

            If Len(signaturePath) > 0 Then
                InsertImageAtBookmark wdDoc, "photo_signature", _
                    signaturePath, CentimetersToPoints(5#), _
                    CentimetersToPoints(2#)
            Else
                ClearImageBookmark wdDoc, "photo_signature"
            End If

            If Len(stampPath) > 0 Then
                InsertImageAtBookmark wdDoc, "photo_stamp", _
                    stampPath, CentimetersToPoints(3.5), _
                    CentimetersToPoints(3.5)
            Else
                ClearImageBookmark wdDoc, "photo_stamp"
            End If

            currentStep = "saving temporary DOCX for Excel row " & _
                rowNumber
            wdDoc.SaveAs2 tempDocxPath, wdFormatXMLDocument

            currentStep = "exporting temporary PDF for Excel row " & _
                rowNumber
            wdDoc.ExportAsFixedFormat tempPdfPath, wdExportFormatPDF

            wdDoc.Close False
            Set wdDoc = Nothing

            currentStep = "rechecking final output names for Excel row " & _
                rowNumber
            If Len(Dir$(docxPath, FILE_ATTRIBUTES)) > 0 Or _
               Len(Dir$(pdfPath, FILE_ATTRIBUTES)) > 0 Then
                Err.Raise vbObjectError + 2707, , _
                    "A final output appeared after preflight for Excel row " & _
                    rowNumber & ": " & baseName
            End If

            currentStep = "moving the completed pair for Excel row " & _
                rowNumber
            Name tempDocxPath As docxPath
            Name tempPdfPath As pdfPath
            tempDocxPath = vbNullString
            tempPdfPath = vbNullString
            generatedCount = generatedCount + 1
        End If
    Next dataRow

    wdApp.Quit
    Set wdApp = Nothing

    currentStep = "removing the empty run-specific temporary folder"
    RmDir runFolder
    runFolder = vbNullString

    MsgBox generatedCount & _
        " DOCX and PDF pairs with image tags were generated.", _
        vbInformation
    Exit Sub

CleanFail:
    errorNumber = Err.Number
    errorDescription = Err.Description

    On Error Resume Next
    If Not wdDoc Is Nothing Then wdDoc.Close False
    If Not wdApp Is Nothing Then wdApp.Quit
    CleanupRunFolder runFolder
    On Error GoTo 0

    MsgBox "Generation stopped while " & currentStep & "." & _
        vbCrLf & "Error " & errorNumber & ": " & _
        errorDescription, vbCritical
End Sub

Private Sub ValidateHeaders(ByVal ws As Worksheet)
    Dim expectedHeaders As Variant
    Dim columnIndex As Long
    Dim actualHeader As String

    expectedHeaders = Array( _
        "DocumentID", "LogoFile", "SignatureFile", _
        "StampFile", "Status")

    For columnIndex = 1 To 5
        If IsError(ws.Cells(1, columnIndex).Value) Then
            RaiseCellError ws, _
                ws.Cells(1, columnIndex).Address(False, False), _
                "The header contains an Excel error."
        End If
        actualHeader = Trim$( _
            CStr(ws.Cells(1, columnIndex).Value2))
        If StrComp(actualHeader, _
                   CStr(expectedHeaders(columnIndex - 1)), _
                   vbBinaryCompare) <> 0 Then
            RaiseCellError ws, _
                ws.Cells(1, columnIndex).Address(False, False), _
                "Expected header: " & _
                CStr(expectedHeaders(columnIndex - 1))
        End If
    Next columnIndex
End Sub

Private Sub VerifyImageBookmarks(ByVal doc As Object)
    Dim requiredBookmarks As Variant
    Dim bookmarkName As Variant

    requiredBookmarks = Array( _
        "photo_logo", "photo_signature", "photo_stamp")
    For Each bookmarkName In requiredBookmarks
        If Not doc.Bookmarks.Exists(CStr(bookmarkName)) Then
            Err.Raise vbObjectError + 2710, , _
                "Required Word bookmark is missing: " & _
                CStr(bookmarkName)
        End If
    Next bookmarkName
End Sub

Private Sub InsertImageAtBookmark(ByVal doc As Object, _
                                  ByVal bookmarkName As String, _
                                  ByVal imagePath As String, _
                                  ByVal maxWidth As Double, _
                                  ByVal maxHeight As Double)
    Dim targetRange As Object
    Dim picture As Object
    Dim widthScale As Double
    Dim heightScale As Double
    Dim scaleFactor As Double

    If Not doc.Bookmarks.Exists(bookmarkName) Then
        Err.Raise vbObjectError + 2711, , _
            "Required Word bookmark is missing: " & bookmarkName
    End If

    Set targetRange = doc.Bookmarks(bookmarkName).Range
    targetRange.Text = vbNullString
    Set picture = targetRange.InlineShapes.AddPicture( _
        imagePath, False, True, targetRange)

    If picture.Width <= 0 Or picture.Height <= 0 Then
        Err.Raise vbObjectError + 2712, , _
            "Word inserted an image with invalid dimensions: " & _
            imagePath
    End If

    picture.LockAspectRatio = msoTrue
    widthScale = maxWidth / picture.Width
    heightScale = maxHeight / picture.Height
    scaleFactor = 1#
    If widthScale < scaleFactor Then scaleFactor = widthScale
    If heightScale < scaleFactor Then scaleFactor = heightScale
    If scaleFactor < 1# Then
        picture.Width = picture.Width * scaleFactor
    End If

    doc.Bookmarks.Add bookmarkName, picture.Range
    If Not doc.Bookmarks.Exists(bookmarkName) Then
        Err.Raise vbObjectError + 2713, , _
            "Image bookmark was not restored: " & bookmarkName
    End If
End Sub

Private Sub ClearImageBookmark(ByVal doc As Object, _
                               ByVal bookmarkName As String)
    Dim targetRange As Object

    If Not doc.Bookmarks.Exists(bookmarkName) Then
        Err.Raise vbObjectError + 2714, , _
            "Required Word bookmark is missing: " & bookmarkName
    End If
    Set targetRange = doc.Bookmarks(bookmarkName).Range
    targetRange.Text = vbNullString
    doc.Bookmarks.Add bookmarkName, targetRange
End Sub

Private Function ResolveImagePath(ByVal imagesFolder As String, _
                                  ByVal imageFile As String, _
                                  ByVal cellAddress As String) As String
    Dim forbiddenCharacters As Variant
    Dim characterItem As Variant
    Dim characterCode As Long
    Dim dotPosition As Long
    Dim extensionName As String
    Dim fullPath As String

    imageFile = Trim$(imageFile)
    forbiddenCharacters = Array( _
        "\", "/", ":", "*", "?", Chr$(34), "<", ">", "|")
    For Each characterItem In forbiddenCharacters
        If InStr(1, imageFile, CStr(characterItem), _
                 vbBinaryCompare) > 0 Then
            Err.Raise vbObjectError + 2720, , _
                cellAddress & _
                " must contain an image file name, not a path."
        End If
    Next characterItem
    For characterCode = 1 To 31
        If InStr(1, imageFile, Chr$(characterCode), _
                 vbBinaryCompare) > 0 Then
            Err.Raise vbObjectError + 2721, , _
                cellAddress & " contains a control character."
        End If
    Next characterCode
    If InStr(1, imageFile, "..", vbBinaryCompare) > 0 Then
        Err.Raise vbObjectError + 2722, , _
            cellAddress & " cannot contain two consecutive dots."
    End If

    dotPosition = InStrRev(imageFile, ".")
    If dotPosition <= 1 Or dotPosition = Len(imageFile) Then
        Err.Raise vbObjectError + 2723, , _
            cellAddress & _
            " must include a PNG, JPG, or JPEG extension."
    End If
    extensionName = LCase$(Mid$(imageFile, dotPosition + 1))
    Select Case extensionName
        Case "png", "jpg", "jpeg"
        Case Else
            Err.Raise vbObjectError + 2723, , _
                cellAddress & _
                " must use a PNG, JPG, or JPEG file."
    End Select

    fullPath = JoinPath(imagesFolder, imageFile)
    If Len(Dir$(fullPath, FILE_ATTRIBUTES)) = 0 Then
        Err.Raise vbObjectError + 2724, , _
            "Image file not found for " & cellAddress & ": " & _
            fullPath
    End If
    If FileLen(fullPath) <= 0 Then
        Err.Raise vbObjectError + 2725, , _
            "Image file is empty for " & cellAddress & ": " & _
            fullPath
    End If
    ResolveImagePath = fullPath
End Function

Private Function ReadRequiredText(ByVal sourceValue As Variant, _
                                  ByVal fieldName As String, _
                                  ByVal cellAddress As String) As String
    If IsError(sourceValue) Then
        Err.Raise vbObjectError + 2730, , _
            cellAddress & ": " & fieldName & _
            " contains an Excel error."
    End If
    ReadRequiredText = Trim$(CStr(sourceValue))
    If Len(ReadRequiredText) = 0 Then
        Err.Raise vbObjectError + 2731, , _
            cellAddress & ": " & fieldName & " is required."
    End If
End Function

Private Function ReadOptionalText(ByVal sourceValue As Variant, _
                                  ByVal cellAddress As String) As String
    If IsError(sourceValue) Then
        Err.Raise vbObjectError + 2732, , _
            cellAddress & " contains an Excel error."
    End If
    ReadOptionalText = Trim$(CStr(sourceValue))
End Function

Private Function CleanFileName(ByVal rawName As String) As String
    Dim invalidCharacters As Variant
    Dim characterItem As Variant
    Dim characterCode As Long
    Dim cleanedName As String

    cleanedName = Trim$(rawName)
    invalidCharacters = Array( _
        "\", "/", ":", "*", "?", Chr$(34), "<", ">", "|")
    For Each characterItem In invalidCharacters
        cleanedName = Replace$( _
            cleanedName, CStr(characterItem), "_")
    Next characterItem
    For characterCode = 1 To 31
        cleanedName = Replace$( _
            cleanedName, Chr$(characterCode), "_")
    Next characterCode

    Do While Len(cleanedName) > 0
        If Right$(cleanedName, 1) = "." Or _
           Right$(cleanedName, 1) = " " Then
            cleanedName = Left$(cleanedName, Len(cleanedName) - 1)
        Else
            Exit Do
        End If
    Loop

    If Len(cleanedName) = 0 Then
        Err.Raise vbObjectError + 2733, , _
            "DocumentID cannot produce a valid file name."
    End If
    If Len(cleanedName) > 100 Then
        cleanedName = Left$(cleanedName, 100)
    End If
    CleanFileName = cleanedName
End Function

Private Function CreateRunFolder(ByVal outputFolder As String) As String
    Dim candidateFolder As String
    Dim timeSuffix As String

    timeSuffix = Format$(CLng((Timer - Fix(Timer)) * 1000), "000")
    candidateFolder = JoinPath( _
        outputFolder, _
        "_run_" & Format$(Now, "yyyymmdd_hhnnss") & _
        "_" & timeSuffix)
    If Len(Dir$(candidateFolder, FOLDER_ATTRIBUTES)) > 0 Then
        Err.Raise vbObjectError + 2740, , _
            "A temporary run folder already exists: " & candidateFolder
    End If
    MkDir candidateFolder
    CreateRunFolder = candidateFolder
End Function

Private Sub CleanupRunFolder(ByVal runFolder As String)
    Dim fileSystem As Object

    If Len(runFolder) = 0 Then Exit Sub
    Set fileSystem = CreateObject("Scripting.FileSystemObject")
    If fileSystem.FolderExists(runFolder) Then
        fileSystem.DeleteFolder runFolder, True
    End If
End Sub

Private Function CentimetersToPoints(ByVal centimeters As Double) _
    As Double
    CentimetersToPoints = centimeters * 28.3464566929134
End Function

Private Function JoinPath(ByVal folderPath As String, _
                          ByVal childName As String) As String
    If Right$(folderPath, 1) = Application.PathSeparator Then
        JoinPath = folderPath & childName
    Else
        JoinPath = folderPath & Application.PathSeparator & childName
    End If
End Function

Private Sub RaiseCellError(ByVal ws As Worksheet, _
                           ByVal cellAddress As String, _
                           ByVal reason As String)
    Err.Raise vbObjectError + 2750, , _
        ws.Name & "!" & cellAddress & ": " & reason
End Sub
Embedded pictures

Word's InlineShapes.AddPicture call uses LinkToFile=False and SaveWithDocument=True, so the result does not depend on the source folder after saving.

Safe final move

After Word closes the temporary DOCX, the VBA Name statement moves each file. Microsoft specifies that the destination name cannot already exist.

What the VBA helper protects

The example is designed to fail before Word opens when the source contract is incomplete, then isolate temporary files if a later Word or PDF step fails.

All rows preflighted

Headers, READY rows, image names, extensions, file existence, file size, duplicate outputs, and existing final files are checked first.

Folder traversal rejected

Image columns accept only file names from the controlled Images folder, not arbitrary paths or parent-folder references.

Fresh template per row

Each output starts from the same untouched Word template instead of inheriting images from the previous record.

No automatic enlargement

Maximum width and height are enforced only when an image is oversized. Smaller source images are left at their native inserted size.

No ordinary overwrite

Final names are checked before and after generation, and the final move fails when the destination already exists.

Run-scoped cleanup

An error deletes only the unique temporary folder created by that run. Files already moved to the final folder remain for manual review.

Desktop test still required

Static review cannot confirm how a particular Word template paginates, whether transparent edges render correctly, or whether organizational security rules permit the assets. Test the actual template in Word Desktop and review the exported PDF.

Use the DocxForge Pro module that matches the job

Image tags are useful only when an asset varies. Keep a universal logo directly in the approved Word template. Use structured image references when each row or case needs a different reviewed file.

Factory: many rows

Factory uses many Excel rows with one standard Word template and creates a separate output for each selected row.

Factory image fit

Use it when each row supplies the approved image references expected by the same standard layout.

Contractor: one case

Contractor keeps one case's data together and produces several different documents from different Word templates.

Contractor image fit

Use it when the same case logo, signature, stamp, or photo set must be reused across several different case documents.

Product boundary

Neither module turns an image into a verified electronic signature or approval record. The product generates document files; your authorization, identity, retention, and release controls remain separate.

See both workflows before choosing

The screenshots are grouped by module so one-case and many-row image workflows are not confused.

Contractor: one case, several different documents

DocxForge Pro Contractor case data screen
Keep the reviewed assets and data for one case together.
DocxForge Pro Contractor documents screen
Apply them across different documents and Word templates.

Factory: many rows, one standard template

DocxForge Pro Factory Excel data screen
Review the rows and their image references before the batch.
DocxForge Pro Factory documents screen
Create one standardized output per selected row.
DocxForge Pro pricing

7 days free, then $38 every 3 months • 14-day refund after purchase • Microsoft Word Desktop required • local processing.

Run a six-record image pilot

Use source files that expose cropping, transparency, scaling, and optional-image behavior before running the full production set.

Wide logo

Confirm the width cap works without stretching and the header or table cell remains stable.

Tall logo

Confirm the height cap works and the result does not push neighboring text unexpectedly.

Transparent signature

Review the background in DOCX and PDF at normal zoom and print size.

Square stamp

Confirm the stamp stays proportional and does not overlap approval text or borders.

Optional images blank

Confirm the signature and stamp placeholders disappear without visible tag text.

Invalid file name

Use a missing or path-like name in a disposable copy and confirm preflight stops before Word opens.

Pilot exit criteria

Approve only after a reviewer matches every source row to the correct logo, signature, and stamp, checks both DOCX and PDF, and confirms that the image assets were authorized for this output.

Frequently asked questions

Should a company logo always use an image tag?

No. If every output uses the same approved logo, embed it directly in the Word template. Use photo_logo only when the file must vary by row, case, brand, or business unit.

Is a scanned signature image a digital signature?

No. It is an image inserted into a document. It does not by itself verify identity, prove consent, create a cryptographic signature, or replace an approval and signing process required by your organization or jurisdiction.

Which image formats does the VBA example accept?

It accepts PNG, JPG, and JPEG file names from the controlled Images folder. Transparent PNG is usually the best starting point for signatures and stamps, but the actual DOCX and PDF must be reviewed.

What happens when SignatureFile or StampFile is blank?

The macro clears the corresponding Word bookmark so visible placeholder text does not remain. LogoFile is required for every READY row in this example.

Which DocxForge Pro module fits image tags?

Factory fits many Excel rows and one standard template. Contractor fits one case and several different documents from different templates. The correct choice depends on the document workflow, not the image type alone.

Can the macro overwrite an existing DOCX or PDF?

It preflights final names, creates each pair in a unique temporary folder, checks final names again, and uses a move operation that fails when a destination already exists. Because a DOCX/PDF pair cannot be committed atomically, shared folders still need coordination and manual review after a rare commit failure.

Standardize image placement without weakening review

Use stable Word tags, controlled image files, explicit module logic, and a real DOCX/PDF pilot. DocxForge Pro can support repeatable local generation when the workflow matches Contractor or Factory.

7 days free, then $38 every 3 months • 14-day refund after purchase • Microsoft Word Desktop required • local processing.