Real Estate Client Packs

Excel → Word → PDF Workflow for Real Estate Client Packs

Turn reviewed listing rows into separate multi-section Word and PDF client packs with one controlled template, embedded property photos, stable filenames, and a release review.

Many listing rows
One pack template
Embedded images
DOCX + PDF
This is Factory logic: one row creates one standardized multi-section document. Property approval, disclosures, permissions, and release remain human decisions.

Quick answer: treat the client pack as one document type

Create one Listings row per client-pack output and one approved RealEstateClientPackTemplate.docx containing all standard sections. Validate every READY row and image before Word starts, create controlled input copies for the run, then generate a separate DOCX/PDF pair for each listing.

Pack does not automatically mean Contractor

A cover page, property summary, price section, photograph, agent details, and next steps can all live inside one reusable template. Contractor is the better model only when one case needs several different documents from several templates.

Create the Listings sheet in one exact A–M order

Required column order in row 1

A PackID; B ClientName; C PropertyAddress; D ListingReference; E AskingPriceDisplay; F PreparedDateDisplay; G PropertySummary; H PropertyPhotoFile; I PropertyPhotoCaption; J AgentLogoFile; K AgentName; L OutputName; M PackStatus.

Stable identity

Store PackID as exact text and keep it unique, including leading zeros. ListingReference is a reviewed business reference, not a substitute for PackID.

Client and property

Verify ClientName and the complete PropertyAddress, including unit, development, or lot references when they matter.

Document-ready display values

Store AskingPriceDisplay and PreparedDateDisplay as the exact text intended for Word; do not rely on Excel number or date formatting.

Multiline summary

Use PropertySummary for reviewed factual copy. Ordinary line breaks are supported; tabs and other control characters are rejected.

Local image filenames

PropertyPhotoFile is required for READY rows. AgentLogoFile is optional. Both are filename-only PNG, JPG, or JPEG values under Assets\PackImages.

Output and status

Use a Windows-safe OutputName without .docx or .pdf and an exact READY, HOLD, or DONE PackStatus.

Status-specific validation

Every populated row needs an exact, unique PackID and a valid PackStatus. HOLD and DONE may leave the remaining business fields blank; when OutputName is present, it must still be safe and unique. The complete B–L contract applies to READY.

Build one multi-section Word client-pack template

Eleven exact bookmarks

Create PackID, ClientName, PropertyAddress, ListingReference, AskingPriceDisplay, PreparedDateDisplay, PropertySummary, PropertyPhoto, PropertyPhotoCaption, AgentLogo, and AgentName.

Clear section architecture

Keep the cover, property overview, commercial details, image, agent block, disclaimers, and next-step section inside the same standard document.

Stable text ranges

Keep each text bookmark within one style and outside nested fields, content controls, images, paragraph markers, and table-cell markers.

Dedicated image ranges

Place PropertyPhoto and AgentLogo in ranges intended only for an inline image. Test portrait, landscape, square, and high-resolution sources.

Clean review state

Turn off Track Changes, resolve revisions in every story, and remove comments before approving the template.

Approved fixed wording

Keep disclaimers, required notices, brand language, contact rules, and fixed labels in a released template rather than rebuilding them from spreadsheet text.

Control property photographs and branding assets

Approved source folder

Place the referenced PNG, JPG, and JPEG files in Assets\PackImages beside the workbook. Do not accept paths, wildcards, or parent-folder navigation in Excel.

Required property image

Every READY row needs one nonempty PropertyPhotoFile plus a reviewed PropertyPhotoCaption that accurately describes the property shown.

Optional agent logo

AgentLogoFile may be blank. If supplied, the macro checks and snapshots it before inserting the image without a live file link.

No authenticity claim

Filename, extension, existence, and size checks do not prove that an image is current, unedited, licensed, or connected to the stated property.

No signature substitution

A logo is branding, not authorization or a digital signature. Apply any signing or approval process separately after reviewing the pack.

Privacy and rights

Confirm image rights, client permissions, occupant privacy, visible personal data, and distribution scope before release.

Preflight the whole batch before opening Word

Workbook gate

Require a writable .xlsm workbook, an unprotected Listings sheet, and the exact A–M headers.

Status gate

Read PackStatus first. Validate the complete content and asset contract only for READY rows.

Uniqueness gate

Reject duplicate PackID values and case-insensitive duplicate OutputName values across every populated row.

Asset gate

Check the template, required property photograph, optional logo, extensions, existence, and nonzero file size before Word starts.

Target gate

Use a unique run folder and refuse existing staged or final targets. SaveAs2 can overwrite, so explicit checks still matter.

Snapshot gate

Copy the approved template and referenced images into InputSnapshot and generate only from those run-specific copies.

Free Excel VBA example: generate real estate client packs

Save the workbook as .xlsm. Create Listings, put RealEstateClientPackTemplate.docx in Templates, put images in Assets\PackImages, and run GenerateRealEstateClientPackBatch. Each run keeps InputSnapshot, Staging, and Completed folders under GeneratedRealEstateClientPacks.

Excel VBA — guarded real estate client-pack batch Factory logic
Option Explicit

Private Const DATA_SHEET As String = "Listings"
Private Const READY_STATUS As String = "READY"
Private Const HOLD_STATUS As String = "HOLD"
Private Const DONE_STATUS As String = "DONE"
Private Const WORD_FORMAT_XML_DOCUMENT As Long = 12
Private Const WORD_EXPORT_FORMAT_PDF As Long = 17
Private Const WORD_EXPORT_OPTIMIZE_FOR_PRINT As Long = 0
Private Const WORD_EXPORT_ALL_DOCUMENT As Long = 0
Private Const WORD_EXPORT_DOCUMENT_CONTENT As Long = 0
Private Const WORD_EXPORT_CREATE_NO_BOOKMARKS As Long = 0
Private Const WORD_DO_NOT_SAVE_CHANGES As Long = 0
Private Const WORD_ALERTS_NONE As Long = 0
Private Const WORD_COLLAPSE_START As Long = 1
Private Const OFFICE_TRUE As Long = -1
Private Const POINTS_PER_CM As Double = 28.3464567
Private Const MAX_PHOTO_WIDTH_CM As Double = 12#
Private Const MAX_PHOTO_HEIGHT_CM As Double = 8#

Public Sub GenerateRealEstateClientPackBatch()
    Dim wb As Workbook
    Dim ws As Worksheet
    Dim fso As Object
    Dim wdApp As Object
    Dim wdDoc As Object
    Dim templatePath As String
    Dim imageFolder As String
    Dim outputRoot As String
    Dim runFolder As String
    Dim inputSnapshotFolder As String
    Dim imageSnapshotFolder As String
    Dim templateSnapshotPath As String
    Dim sourceImagePath As String
    Dim snapshotImagePath As String
    Dim stagingFolder As String
    Dim completedFolder As String
    Dim tempDocxPath As String
    Dim tempPdfPath As String
    Dim finalDocxPath As String
    Dim finalPdfPath As String
    Dim data As Variant
    Dim propertyPhotoPaths() As String
    Dim agentLogoPaths() As String
    Dim lastRow As Long
    Dim dataRow As Long
    Dim excelRow As Long
    Dim readyCount As Long
    Dim generatedCount As Long
    Dim packId As String
    Dim clientName As String
    Dim propertyAddress As String
    Dim listingReference As String
    Dim askingPriceDisplay As String
    Dim preparedDateDisplay As String
    Dim propertySummary As String
    Dim propertyPhotoFile As String
    Dim propertyPhotoCaption As String
    Dim agentLogoFile As String
    Dim agentName As String
    Dim outputName As String
    Dim packStatus As String
    Dim packIds As Object
    Dim outputNames As Object
    Dim imageSnapshots As Object
    Dim previousScreenUpdating As Boolean
    Dim previousEnableEvents As Boolean
    Dim appStateCaptured As Boolean
    Dim currentStep As String
    Dim errorNumber As Long
    Dim errorDescription As String
    Dim statusSavePending As Boolean
    Dim statusRow As Long
    Dim statusRecoveryMessage As String

    On Error GoTo CleanFail

    Set wb = ThisWorkbook
    previousScreenUpdating = Application.ScreenUpdating
    previousEnableEvents = Application.EnableEvents
    appStateCaptured = True
    Application.ScreenUpdating = False
    Application.EnableEvents = False

    currentStep = "checking the macro-enabled workbook"
    RequireWritableMacroWorkbook wb
    Set ws = wb.Worksheets(DATA_SHEET)
    If ws.ProtectContents Then
        Err.Raise vbObjectError + 5000, , _
            "The Listings sheet is protected against status updates."
    End If
    ValidateHeaders ws
    lastRow = FindLastDataRow(ws)
    If lastRow < 2 Then
        Err.Raise vbObjectError + 5001, , _
            "No listing rows were found below row 1."
    End If

    templatePath = JoinPath(JoinPath(wb.Path, "Templates"), _
        "RealEstateClientPackTemplate.docx")
    imageFolder = JoinPath(JoinPath(wb.Path, "Assets"), _
        "PackImages")
    outputRoot = JoinPath(wb.Path, "GeneratedRealEstateClientPacks")
    RequireNonemptyFile templatePath, "real estate client pack template"

    data = ws.Range("A2:M" & lastRow).Value2
    ReDim propertyPhotoPaths(1 To UBound(data, 1))
    ReDim agentLogoPaths(1 To UBound(data, 1))
    Set packIds = CreateObject("Scripting.Dictionary")
    packIds.CompareMode = vbTextCompare
    Set outputNames = CreateObject("Scripting.Dictionary")
    outputNames.CompareMode = vbTextCompare

    currentStep = "preflighting Excel Listings rows"
    For dataRow = 1 To UBound(data, 1)
        excelRow = dataRow + 1
        If Not DataRowIsBlank(data, dataRow) Then
            packStatus = ReadRequiredText(data(dataRow, 13), _
                "PackStatus", excelRow)
            ValidateStatus packStatus, excelRow
            packId = ReadRequiredText(data(dataRow, 1), _
                "PackID", excelRow)
            ValidateIdentifier packId, "PackID", excelRow
            AddUniqueValue packIds, packId, "PackID", excelRow

            outputName = ReadOptionalText(data(dataRow, 12), _
                "OutputName", excelRow)
            If Len(outputName) > 0 Then
                ValidateFileStem outputName, excelRow
                AddUniqueValue outputNames, outputName, _
                    "OutputName", excelRow
            End If

            If StrComp(packStatus, READY_STATUS, _
               vbBinaryCompare) = 0 Then
                clientName = ReadRequiredText(data(dataRow, 2), _
                    "ClientName", excelRow)
                propertyAddress = ReadRequiredText(data(dataRow, 3), _
                    "PropertyAddress", excelRow)
                listingReference = ReadRequiredText(data(dataRow, 4), _
                    "ListingReference", excelRow)
                askingPriceDisplay = ReadRequiredText(data(dataRow, 5), _
                    "AskingPriceDisplay", excelRow)
                preparedDateDisplay = ReadRequiredText(data(dataRow, 6), _
                    "PreparedDateDisplay", excelRow)
                propertySummary = ReadRequiredMultilineText(data(dataRow, 7), _
                    "PropertySummary", excelRow)
                propertyPhotoFile = ReadRequiredText(data(dataRow, 8), _
                    "PropertyPhotoFile", excelRow)
                propertyPhotoCaption = ReadRequiredText(data(dataRow, 9), _
                    "PropertyPhotoCaption", excelRow)
                agentLogoFile = ReadOptionalText(data(dataRow, 10), _
                    "AgentLogoFile", excelRow)
                agentName = ReadRequiredText(data(dataRow, 11), _
                    "AgentName", excelRow)
                If Len(outputName) = 0 Then
                    Err.Raise vbObjectError + 5054, , _
                        "OutputName is required for READY row " & excelRow & "."
                End If

                ValidateImageFileName propertyPhotoFile, _
                    "PropertyPhotoFile", excelRow
                propertyPhotoPaths(dataRow) = JoinPath( _
                    imageFolder, propertyPhotoFile)
                RequireNonemptyFile propertyPhotoPaths(dataRow), _
                    "property image for row " & excelRow

                If Len(agentLogoFile) > 0 Then
                    ValidateImageFileName agentLogoFile, _
                        "AgentLogoFile", excelRow
                    If StrComp(propertyPhotoFile, agentLogoFile, _
                       vbTextCompare) = 0 Then
                        Err.Raise vbObjectError + 5055, , _
                            "PropertyPhotoFile and AgentLogoFile must be different " & _
                            "on row " & excelRow & "."
                    End If
                    agentLogoPaths(dataRow) = JoinPath( _
                        imageFolder, agentLogoFile)
                    RequireNonemptyFile agentLogoPaths(dataRow), _
                        "agent logo for row " & excelRow
                End If
                readyCount = readyCount + 1
            End If
        End If
    Next dataRow

    If readyCount = 0 Then
        Err.Raise vbObjectError + 5002, , _
            "No Listings rows are marked exactly READY."
    End If

    currentStep = "saving the preflighted Excel workbook"
    wb.Save

    Set fso = CreateObject("Scripting.FileSystemObject")
    EnsureFolder outputRoot
    runFolder = CreateRunFolder(fso, outputRoot)
    inputSnapshotFolder = JoinPath(runFolder, "InputSnapshot")
    imageSnapshotFolder = JoinPath(inputSnapshotFolder, "PackImages")
    stagingFolder = JoinPath(runFolder, "Staging")
    completedFolder = JoinPath(runFolder, "Completed")
    fso.CreateFolder inputSnapshotFolder
    fso.CreateFolder imageSnapshotFolder
    fso.CreateFolder stagingFolder
    fso.CreateFolder completedFolder

    currentStep = "creating the controlled input snapshot"
    templateSnapshotPath = JoinPath(inputSnapshotFolder, _
        "RealEstateClientPackTemplate.docx")
    CopyFileToSnapshot fso, templatePath, templateSnapshotPath, _
        "real estate client pack template"
    Set imageSnapshots = CreateObject("Scripting.Dictionary")
    imageSnapshots.CompareMode = vbTextCompare
    For dataRow = 1 To UBound(data, 1)
        packStatus = CStr(data(dataRow, 13))
        If StrComp(packStatus, READY_STATUS, _
           vbBinaryCompare) = 0 Then
            propertyPhotoFile = CStr(data(dataRow, 8))
            If Len(propertyPhotoFile) > 0 And _
               Not imageSnapshots.Exists(propertyPhotoFile) Then
                sourceImagePath = propertyPhotoPaths(dataRow)
                snapshotImagePath = JoinPath( _
                    imageSnapshotFolder, propertyPhotoFile)
                CopyFileToSnapshot fso, sourceImagePath, _
                    snapshotImagePath, _
                    "image " & propertyPhotoFile
                imageSnapshots.Add propertyPhotoFile, _
                    snapshotImagePath
            End If
            If Len(propertyPhotoFile) > 0 Then _
                propertyPhotoPaths(dataRow) = imageSnapshots(propertyPhotoFile)

            agentLogoFile = CStr(data(dataRow, 10))
            If Len(agentLogoFile) > 0 And _
               Not imageSnapshots.Exists(agentLogoFile) Then
                sourceImagePath = agentLogoPaths(dataRow)
                snapshotImagePath = JoinPath( _
                    imageSnapshotFolder, agentLogoFile)
                CopyFileToSnapshot fso, sourceImagePath, _
                    snapshotImagePath, _
                    "image " & agentLogoFile
                imageSnapshots.Add agentLogoFile, _
                    snapshotImagePath
            End If
            If Len(agentLogoFile) > 0 Then _
                agentLogoPaths(dataRow) = imageSnapshots(agentLogoFile)
        End If
    Next dataRow

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

    currentStep = "validating the real estate client pack template snapshot"
    Set wdDoc = wdApp.Documents.Open( _
        templateSnapshotPath, False, True, False)
    ValidateClientPackTemplate wdDoc
    wdDoc.Close WORD_DO_NOT_SAVE_CHANGES
    Set wdDoc = Nothing

    For dataRow = 1 To UBound(data, 1)
        excelRow = dataRow + 1
        packStatus = CStr(data(dataRow, 13))
        If StrComp(packStatus, READY_STATUS, _
           vbBinaryCompare) = 0 Then
            currentStep = "rechecking Excel row " & excelRow
            RequireRowUnchanged ws, excelRow, data, dataRow

            packId = CStr(data(dataRow, 1))
            clientName = CStr(data(dataRow, 2))
            propertyAddress = CStr(data(dataRow, 3))
            listingReference = CStr(data(dataRow, 4))
            askingPriceDisplay = CStr(data(dataRow, 5))
            preparedDateDisplay = CStr(data(dataRow, 6))
            propertySummary = NormalizeMultilineText(CStr(data(dataRow, 7)))
            propertyPhotoFile = CStr(data(dataRow, 8))
            propertyPhotoCaption = CStr(data(dataRow, 9))
            agentLogoFile = CStr(data(dataRow, 10))
            agentName = CStr(data(dataRow, 11))
            outputName = CStr(data(dataRow, 12))

            tempDocxPath = JoinPath(stagingFolder, outputName & ".docx")
            tempPdfPath = JoinPath(stagingFolder, outputName & ".pdf")
            finalDocxPath = JoinPath(completedFolder, outputName & ".docx")
            finalPdfPath = JoinPath(completedFolder, outputName & ".pdf")
            RequireTargetAbsent tempDocxPath
            RequireTargetAbsent tempPdfPath
            RequireTargetAbsent finalDocxPath
            RequireTargetAbsent finalPdfPath

            currentStep = "generating Listings row " & excelRow
            Set wdDoc = wdApp.Documents.Open( _
                templateSnapshotPath, False, True, False)
            WriteRequiredBookmark wdDoc, "PackID", packId
            WriteRequiredBookmark wdDoc, "ClientName", clientName
            WriteRequiredBookmark wdDoc, "PropertyAddress", propertyAddress
            WriteRequiredBookmark wdDoc, "ListingReference", _
                listingReference
            WriteRequiredBookmark wdDoc, "AskingPriceDisplay", askingPriceDisplay
            WriteRequiredBookmark wdDoc, "PreparedDateDisplay", preparedDateDisplay
            WriteRequiredBookmark wdDoc, "PropertySummary", propertySummary
            InsertOptionalPhotoBookmark wdDoc, "PropertyPhoto", _
                propertyPhotoPaths(dataRow)
            WriteRequiredBookmark wdDoc, "PropertyPhotoCaption", propertyPhotoCaption
            InsertOptionalPhotoBookmark wdDoc, "AgentLogo", _
                agentLogoPaths(dataRow)
            WriteRequiredBookmark wdDoc, "AgentName", agentName
            ValidateClientPackResultBeforeSave wdDoc

            wdDoc.SaveAs2 tempDocxPath, WORD_FORMAT_XML_DOCUMENT
            wdDoc.ExportAsFixedFormat _
                tempPdfPath, _
                WORD_EXPORT_FORMAT_PDF, _
                False, _
                WORD_EXPORT_OPTIMIZE_FOR_PRINT, _
                WORD_EXPORT_ALL_DOCUMENT, _
                1, _
                1, _
                WORD_EXPORT_DOCUMENT_CONTENT, _
                True, _
                True, _
                WORD_EXPORT_CREATE_NO_BOOKMARKS, _
                True, _
                True, _
                False
            wdDoc.Close WORD_DO_NOT_SAVE_CHANGES
            Set wdDoc = Nothing

            RequireNonemptyFile tempDocxPath, _
                "staged DOCX for row " & excelRow
            RequireNonemptyFile tempPdfPath, _
                "staged PDF for row " & excelRow
            RequireTargetAbsent finalDocxPath
            RequireTargetAbsent finalPdfPath
            Name tempDocxPath As finalDocxPath
            Name tempPdfPath As finalPdfPath

            currentStep = "saving DONE for Listings row " & excelRow
            statusRow = excelRow
            statusSavePending = True
            ws.Cells(excelRow, 13).Value2 = DONE_STATUS
            wb.Save
            statusSavePending = False
            generatedCount = generatedCount + 1
        End If
    Next dataRow

    wdApp.NormalTemplate.Saved = True
    wdApp.Quit WORD_DO_NOT_SAVE_CHANGES
    Set wdApp = Nothing

    Application.EnableEvents = previousEnableEvents
    Application.ScreenUpdating = previousScreenUpdating
    appStateCaptured = False

    MsgBox "Real estate client pack batch completed." & vbCrLf & _
        "Real estate client packs generated: " & generatedCount & vbCrLf & _
        "Completed folder: " & completedFolder & vbCrLf & vbCrLf & _
        "Review Listings data, the property image and optional agent logo, DOCX, and PDF before release.", _
        vbInformation

CleanExit:
    On Error Resume Next
    If Not wdDoc Is Nothing Then _
        wdDoc.Close WORD_DO_NOT_SAVE_CHANGES
    If Not wdApp Is Nothing Then
        wdApp.NormalTemplate.Saved = True
        wdApp.Quit WORD_DO_NOT_SAVE_CHANGES
    End If
    If appStateCaptured Then
        Application.EnableEvents = previousEnableEvents
        Application.ScreenUpdating = previousScreenUpdating
    End If
    Set wdDoc = Nothing
    Set wdApp = Nothing
    Set fso = Nothing
    Set imageSnapshots = Nothing
    Set ws = Nothing
    Set wb = Nothing
    On Error GoTo 0
    Exit Sub

CleanFail:
    errorNumber = Err.Number
    errorDescription = Err.Description
    On Error Resume Next
    If statusSavePending And Not ws Is Nothing Then
        ws.Cells(statusRow, 13).Value2 = packStatus
        statusRecoveryMessage = vbCrLf & _
            "DONE was restored to " & packStatus & _
            " in memory because the workbook save was not confirmed."
    End If
    If Not wdDoc Is Nothing Then _
        wdDoc.Close WORD_DO_NOT_SAVE_CHANGES
    If Not wdApp Is Nothing Then
        wdApp.NormalTemplate.Saved = True
        wdApp.Quit WORD_DO_NOT_SAVE_CHANGES
    End If
    If appStateCaptured Then
        Application.EnableEvents = previousEnableEvents
        Application.ScreenUpdating = previousScreenUpdating
    End If
    Set wdDoc = Nothing
    Set wdApp = Nothing
    Set fso = Nothing
    Set imageSnapshots = Nothing
    Set ws = Nothing
    Set wb = Nothing
    On Error GoTo 0

    MsgBox "Real estate client pack generation stopped while " & currentStep & "." & _
        vbCrLf & "Error " & errorNumber & ": " & errorDescription & _
        vbCrLf & IIf(Len(runFolder) > 0, _
            "Inspect the retained run folder: " & runFolder, _
            "No run folder was created.") & vbCrLf & _
        "Existing completed files were not deleted." & _
        statusRecoveryMessage, vbCritical
End Sub

Private Sub CopyFileToSnapshot(ByVal fso As Object, _
                               ByVal sourcePath As String, _
                               ByVal snapshotPath As String, _
                               ByVal fileLabel As String)
    Dim sourceSize As Variant
    Dim sourceModified As Date
    Dim errorDescription As String

    RequireNonemptyFile sourcePath, fileLabel
    RequireTargetAbsent snapshotPath
    On Error GoTo CopyFailed
    sourceSize = fso.GetFile(sourcePath).Size
    sourceModified = fso.GetFile(sourcePath).DateLastModified
    fso.CopyFile sourcePath, snapshotPath, False
    RequireNonemptyFile snapshotPath, fileLabel & " snapshot"
    If fso.GetFile(snapshotPath).Size <> sourceSize Then
        Err.Raise vbObjectError + 5046, , _
            "Snapshot size differs from the source " & fileLabel & "."
    End If
    If fso.GetFile(sourcePath).Size <> sourceSize Or _
       fso.GetFile(sourcePath).DateLastModified <> sourceModified Then
        Err.Raise vbObjectError + 5047, , _
            "The source " & fileLabel & _
            " changed while its run snapshot was being created."
    End If
    Exit Sub
CopyFailed:
    errorDescription = Err.Description
    Err.Raise vbObjectError + 5048, , _
        "Could not create the controlled " & fileLabel & _
        " snapshot: " & errorDescription
End Sub

Private Sub RequireWritableMacroWorkbook(ByVal wb As Workbook)
    If Len(wb.Path) = 0 Then
        Err.Raise vbObjectError + 5003, , _
            "Save the Excel workbook before generation."
    End If
    If LCase$(Right$(wb.Name, 5)) <> ".xlsm" Then
        Err.Raise vbObjectError + 5004, , _
            "Save the workbook as an Excel Macro-Enabled Workbook (.xlsm)."
    End If
    If wb.ReadOnly Then
        Err.Raise vbObjectError + 5005, , _
            "The Excel workbook is read-only; DONE statuses cannot be saved."
    End If
End Sub

Private Sub ValidateHeaders(ByVal ws As Worksheet)
    Dim expected As Variant
    Dim columnIndex As Long
    Dim actualText As String

    expected = Array("PackID", "ClientName", "PropertyAddress", _
        "ListingReference", "AskingPriceDisplay", "PreparedDateDisplay", _
        "PropertySummary", "PropertyPhotoFile", "PropertyPhotoCaption", _
        "AgentLogoFile", "AgentName", "OutputName", "PackStatus")
    For columnIndex = 1 To 13
        If IsError(ws.Cells(1, columnIndex).Value2) Then
            Err.Raise vbObjectError + 5006, , _
                "Header cell " & ws.Cells(1, columnIndex).Address(False, False) & _
                " contains an Excel error."
        End If
        If VarType(ws.Cells(1, columnIndex).Value2) <> vbString Then
            Err.Raise vbObjectError + 5007, , _
                "Header cell " & ws.Cells(1, columnIndex).Address(False, False) & _
                " must contain exact text."
        End If
        actualText = CStr(ws.Cells(1, columnIndex).Value2)
        If StrComp(actualText, CStr(expected(columnIndex - 1)), _
           vbBinaryCompare) <> 0 Then
            Err.Raise vbObjectError + 5008, , _
                "Expected header " & expected(columnIndex - 1) & _
                " in column " & columnIndex & ", found " & actualText & "."
        End If
    Next columnIndex
End Sub

Private Function FindLastDataRow(ByVal ws As Worksheet) As Long
    Dim lastCell As Range

    Set lastCell = ws.Range("A:M").Find( _
        What:="*", _
        After:=ws.Cells(1, 1), _
        LookIn:=xlFormulas, _
        LookAt:=xlPart, _
        SearchOrder:=xlByRows, _
        SearchDirection:=xlPrevious, _
        MatchCase:=False)
    If lastCell Is Nothing Then
        FindLastDataRow = 0
    Else
        FindLastDataRow = lastCell.Row
    End If
End Function

Private Function DataRowIsBlank(ByRef data As Variant, _
                                ByVal dataRow As Long) As Boolean
    Dim columnIndex As Long

    DataRowIsBlank = True
    For columnIndex = 1 To 13
        If IsError(data(dataRow, columnIndex)) Then
            DataRowIsBlank = False
            Exit Function
        End If
        If Len(CStr(data(dataRow, columnIndex))) > 0 Then
            DataRowIsBlank = False
            Exit Function
        End If
    Next columnIndex
End Function

Private Function ReadRequiredText(ByVal rawValue As Variant, _
                                  ByVal fieldName As String, _
                                  ByVal excelRow As Long) As String
    If IsError(rawValue) Then
        Err.Raise vbObjectError + 5009, , _
            fieldName & " contains an Excel error on row " & excelRow & "."
    End If
    If VarType(rawValue) <> vbString Then
        Err.Raise vbObjectError + 5010, , _
            fieldName & " must be stored as text on row " & excelRow & "."
    End If
    ReadRequiredText = CStr(rawValue)
    If Len(ReadRequiredText) = 0 Then
        Err.Raise vbObjectError + 5011, , _
            fieldName & " is blank on row " & excelRow & "."
    End If
    If ReadRequiredText <> Trim$(ReadRequiredText) Then
        Err.Raise vbObjectError + 5012, , _
            fieldName & " has outer whitespace on row " & excelRow & "."
    End If
    If ContainsControlCharacter(ReadRequiredText) Then
        Err.Raise vbObjectError + 5013, , _
            fieldName & " contains a control character on row " & excelRow & "."
    End If
End Function

Private Function ReadOptionalText(ByVal rawValue As Variant, _
                                  ByVal fieldName As String, _
                                  ByVal excelRow As Long) As String
    If IsEmpty(rawValue) Then
        ReadOptionalText = ""
        Exit Function
    End If
    If IsError(rawValue) Then
        Err.Raise vbObjectError + 5056, , _
            fieldName & " contains an Excel error on row " & excelRow & "."
    End If
    If VarType(rawValue) <> vbString Then
        Err.Raise vbObjectError + 5057, , _
            fieldName & " must be stored as text on row " & excelRow & "."
    End If
    ReadOptionalText = CStr(rawValue)
    If ReadOptionalText <> Trim$(ReadOptionalText) Then
        Err.Raise vbObjectError + 5058, , _
            fieldName & " has outer whitespace on row " & excelRow & "."
    End If
    If ContainsControlCharacter(ReadOptionalText) Then
        Err.Raise vbObjectError + 5059, , _
            fieldName & " contains a control character on row " & excelRow & "."
    End If
End Function

Private Function ReadRequiredMultilineText(ByVal rawValue As Variant, _
                                           ByVal fieldName As String, _
                                           ByVal excelRow As Long) As String
    Dim valueText As String
    Dim position As Long
    Dim characterCode As Long

    If IsEmpty(rawValue) Or IsError(rawValue) Then
        Err.Raise vbObjectError + 5060, , _
            fieldName & " must contain reviewed text on row " & excelRow & "."
    End If
    If VarType(rawValue) <> vbString Then
        Err.Raise vbObjectError + 5061, , _
            fieldName & " must be stored as text on row " & excelRow & "."
    End If
    valueText = CStr(rawValue)
    valueText = Replace(valueText, vbCrLf, vbLf)
    valueText = Replace(valueText, vbCr, vbLf)
    If Len(valueText) = 0 Or Len(Trim$(Replace(valueText, vbLf, ""))) = 0 Then
        Err.Raise vbObjectError + 5062, , _
            fieldName & " must contain meaningful text on row " & excelRow & "."
    End If
    If valueText <> Trim$(valueText) Or _
       Left$(valueText, 1) = vbLf Or Right$(valueText, 1) = vbLf Then
        Err.Raise vbObjectError + 5063, , _
            fieldName & " has outer whitespace on row " & excelRow & "."
    End If
    For position = 1 To Len(valueText)
        characterCode = AscW(Mid$(valueText, position, 1))
        If characterCode >= 0 And characterCode <= 31 And _
           characterCode <> 10 Then
            Err.Raise vbObjectError + 5064, , _
                fieldName & " contains an unsupported control character on row " & _
                excelRow & "."
        End If
    Next position
    ReadRequiredMultilineText = NormalizeMultilineText(valueText)
End Function

Private Function NormalizeMultilineText(ByVal valueText As String) As String
    valueText = Replace(valueText, vbCrLf, vbLf)
    valueText = Replace(valueText, vbCr, vbLf)
    NormalizeMultilineText = Replace(valueText, vbLf, vbCr)
End Function

Private Sub ValidateStatus(ByVal statusText As String, _
                           ByVal excelRow As Long)
    If StrComp(statusText, READY_STATUS, vbBinaryCompare) <> 0 And _
       StrComp(statusText, HOLD_STATUS, vbBinaryCompare) <> 0 And _
       StrComp(statusText, DONE_STATUS, vbBinaryCompare) <> 0 Then
        Err.Raise vbObjectError + 5014, , _
            "PackStatus must be exactly READY, HOLD, or DONE on row " & _
            excelRow & "."
    End If
End Sub



Private Sub ValidateIdentifier(ByVal identifierText As String, _
                               ByVal fieldName As String, _
                               ByVal excelRow As Long)
    If Len(identifierText) > 80 Then
        Err.Raise vbObjectError + 5015, , _
            fieldName & " exceeds 80 characters on row " & excelRow & "."
    End If
End Sub

Private Sub AddUniqueValue(ByVal valuesSeen As Object, _
                           ByVal valueText As String, _
                           ByVal fieldName As String, _
                           ByVal excelRow As Long)
    If valuesSeen.Exists(valueText) Then
        Err.Raise vbObjectError + 5016, , _
            "Duplicate " & fieldName & " on rows " & _
            valuesSeen(valueText) & " and " & excelRow & ": " & valueText
    End If
    valuesSeen.Add valueText, excelRow
End Sub

Private Sub ValidateImageFileName(ByVal fileName As String, _
                                  ByVal fieldName As String, _
                                  ByVal excelRow As Long)
    Dim extensionPosition As Long
    Dim extensionText As String
    Dim baseName As String
    Dim forbidden As Variant
    Dim item As Variant

    forbidden = Array("<", ">", ":", Chr$(34), "/", "\", "|", "?", "*")
    For Each item In forbidden
        If InStr(1, fileName, CStr(item), vbBinaryCompare) > 0 Then
            Err.Raise vbObjectError + 5017, , _
                fieldName & " contains a forbidden path character on row " & _
                excelRow & "."
        End If
    Next item
    If Right$(fileName, 1) = "." Or Right$(fileName, 1) = " " Then
        Err.Raise vbObjectError + 5018, , _
            fieldName & " cannot end with a period or space on row " & _
            excelRow & "."
    End If
    extensionPosition = InStrRev(fileName, ".")
    If extensionPosition <= 1 Then
        Err.Raise vbObjectError + 5019, , _
            fieldName & " needs a PNG, JPG, or JPEG extension on row " & _
            excelRow & "."
    End If
    extensionText = UCase$(Mid$(fileName, extensionPosition + 1))
    If extensionText <> "PNG" And extensionText <> "JPG" And _
       extensionText <> "JPEG" Then
        Err.Raise vbObjectError + 5020, , _
            fieldName & " must use PNG, JPG, or JPEG on row " & excelRow & "."
    End If
    baseName = Left$(fileName, extensionPosition - 1)
    If IsReservedWindowsName(baseName) Then
        Err.Raise vbObjectError + 5053, , _
            fieldName & " uses a reserved Windows name on row " & excelRow & "."
    End If
End Sub

Private Sub ValidateFileStem(ByVal fileStem As String, _
                             ByVal excelRow As Long)
    Dim invalidCharacters As Variant
    Dim invalidCharacter As Variant
    Dim baseName As String
    Dim lowerName As String

    If Len(fileStem) > 120 Then
        Err.Raise vbObjectError + 5021, , _
            "OutputName exceeds 120 characters on row " & excelRow & "."
    End If
    lowerName = LCase$(fileStem)
    If Right$(lowerName, 5) = ".docx" Or _
       Right$(lowerName, 4) = ".pdf" Then
        Err.Raise vbObjectError + 5049, , _
            "OutputName must not include a .docx or .pdf extension on row " & _
            excelRow & "."
    End If
    invalidCharacters = Array("<", ">", ":", Chr$(34), "/", "\", _
        "|", "?", "*")
    For Each invalidCharacter In invalidCharacters
        If InStr(1, fileStem, CStr(invalidCharacter), vbBinaryCompare) > 0 Then
            Err.Raise vbObjectError + 5022, , _
                "OutputName contains a forbidden Windows character on row " & _
                excelRow & "."
        End If
    Next invalidCharacter
    If Right$(fileStem, 1) = "." Or Right$(fileStem, 1) = " " Then
        Err.Raise vbObjectError + 5023, , _
            "OutputName cannot end with a period or space on row " & _
            excelRow & "."
    End If
    baseName = fileStem
    If InStr(1, baseName, ".", vbBinaryCompare) > 0 Then
        baseName = Left$(baseName, InStr(1, baseName, ".", _
            vbBinaryCompare) - 1)
    End If
    If IsReservedWindowsName(baseName) Then
        Err.Raise vbObjectError + 5024, , _
            "OutputName uses a reserved Windows name on row " & excelRow & "."
    End If
End Sub

Private Sub ValidateClientPackTemplate(ByVal doc As Object)
    RejectTrackedChanges doc, "real estate client pack template snapshot"
    If doc.Comments.Count > 0 Then
        Err.Raise vbObjectError + 5026, , _
            "Remove comments from RealEstateClientPackTemplate.docx."
    End If
    RequireBookmark doc, "PackID"
    RequireBookmark doc, "ClientName"
    RequireBookmark doc, "PropertyAddress"
    RequireBookmark doc, "ListingReference"
    RequireBookmark doc, "AskingPriceDisplay"
    RequireBookmark doc, "PreparedDateDisplay"
    RequireBookmark doc, "PropertySummary"
    RequireBookmark doc, "PropertyPhoto"
    RequireBookmark doc, "PropertyPhotoCaption"
    RequireBookmark doc, "AgentLogo"
    RequireBookmark doc, "AgentName"
End Sub

Private Sub ValidateClientPackResultBeforeSave(ByVal doc As Object)
    RejectTrackedChanges doc, "generated real estate client pack"
    If doc.Comments.Count > 0 Then
        Err.Raise vbObjectError + 5050, , _
            "The generated real estate client pack contains a comment before saving."
    End If
    RequireBookmark doc, "PackID"
    RequireBookmark doc, "ClientName"
    RequireBookmark doc, "PropertyAddress"
    RequireBookmark doc, "ListingReference"
    RequireBookmark doc, "AskingPriceDisplay"
    RequireBookmark doc, "PreparedDateDisplay"
    RequireBookmark doc, "PropertySummary"
    RequireBookmark doc, "PropertyPhoto"
    RequireBookmark doc, "PropertyPhotoCaption"
    RequireBookmark doc, "AgentLogo"
    RequireBookmark doc, "AgentName"
End Sub

Private Sub RejectTrackedChanges(ByVal doc As Object, _
                                 ByVal documentLabel As String)
    If doc.TrackRevisions Then
        Err.Raise vbObjectError + 5051, , _
            "Turn off Track Changes in the " & documentLabel & "."
    End If
    If CountRevisionsInAllStories(doc) > 0 Then
        Err.Raise vbObjectError + 5052, , _
            "Resolve tracked revisions in every story of the " & _
            documentLabel & "."
    End If
End Sub

Private Function CountRevisionsInAllStories(ByVal doc As Object) As Long
    Dim storyRoot As Object
    Dim currentStory As Object
    Dim revisionCount As Long

    For Each storyRoot In doc.StoryRanges
        Set currentStory = storyRoot
        Do While Not currentStory Is Nothing
            revisionCount = revisionCount + currentStory.Revisions.Count
            Set currentStory = currentStory.NextStoryRange
        Loop
    Next storyRoot
    CountRevisionsInAllStories = revisionCount
End Function

Private Sub RequireBookmark(ByVal doc As Object, _
                            ByVal bookmarkName As String)
    If Not doc.Bookmarks.Exists(bookmarkName) Then
        Err.Raise vbObjectError + 5027, , _
            "Missing required Word bookmark: " & bookmarkName
    End If
End Sub

Private Sub WriteRequiredBookmark(ByVal doc As Object, _
                                  ByVal bookmarkName As String, _
                                  ByVal replacementText As String)
    Dim targetRange As Object
    Dim styleValue As Variant

    RequireBookmark doc, bookmarkName
    Set targetRange = doc.Bookmarks(bookmarkName).Range
    If targetRange.Fields.Count > 0 Or _
       targetRange.ContentControls.Count > 0 Or _
       targetRange.InlineShapes.Count > 0 Then
        Err.Raise vbObjectError + 5028, , _
            "Text bookmark contains a field, content control, or image: " & _
            bookmarkName
    End If
    If InStr(1, targetRange.Text, vbCr, vbBinaryCompare) > 0 Or _
       InStr(1, targetRange.Text, Chr$(7), vbBinaryCompare) > 0 Then
        Err.Raise vbObjectError + 5029, , _
            "Text bookmark includes a paragraph or cell marker: " & bookmarkName
    End If
    styleValue = targetRange.Style
    targetRange.Text = replacementText
    targetRange.Style = styleValue
    doc.Bookmarks.Add bookmarkName, targetRange
    If Not doc.Bookmarks.Exists(bookmarkName) Then
        Err.Raise vbObjectError + 5030, , _
            "Bookmark was not restored: " & bookmarkName
    End If
    If StrComp(CStr(doc.Bookmarks(bookmarkName).Range.Text), _
       replacementText, vbBinaryCompare) <> 0 Then
        Err.Raise vbObjectError + 5031, , _
            "Bookmark value differs after replacement: " & bookmarkName
    End If
End Sub

Private Sub InsertOptionalPhotoBookmark(ByVal doc As Object, _
                                        ByVal bookmarkName As String, _
                                        ByVal photoPath As String)
    Dim targetRange As Object
    Dim picture As Object
    Dim maximumWidth As Double
    Dim maximumHeight As Double

    RequireBookmark doc, bookmarkName
    Set targetRange = doc.Bookmarks(bookmarkName).Range
    If targetRange.Fields.Count > 0 Or _
       targetRange.ContentControls.Count > 0 Or _
       targetRange.InlineShapes.Count > 0 Then
        Err.Raise vbObjectError + 5032, , _
            "Photo bookmark contains a nested object."
    End If
    If InStr(1, targetRange.Text, vbCr, vbBinaryCompare) > 0 Or _
       InStr(1, targetRange.Text, Chr$(7), vbBinaryCompare) > 0 Then
        Err.Raise vbObjectError + 5033, , _
            "Photo bookmark includes a paragraph or cell marker."
    End If

    targetRange.Text = ""
    targetRange.Collapse WORD_COLLAPSE_START
    If Len(photoPath) = 0 Then
        doc.Bookmarks.Add bookmarkName, targetRange
        If Not doc.Bookmarks.Exists(bookmarkName) Then
            Err.Raise vbObjectError + 5067, , _
                "Empty image bookmark was not restored: " & bookmarkName
        End If
        If doc.Bookmarks(bookmarkName).Range.InlineShapes.Count <> 0 Then
            Err.Raise vbObjectError + 5068, , _
                "Empty image bookmark contains an embedded picture."
        End If
        Exit Sub
    End If
    Set picture = doc.InlineShapes.AddPicture( _
        photoPath, False, True, targetRange)
    If picture.Width <= 0 Or picture.Height <= 0 Then
        Err.Raise vbObjectError + 5034, , _
            "Word inserted an invalid photo."
    End If
    picture.LockAspectRatio = OFFICE_TRUE
    maximumWidth = MAX_PHOTO_WIDTH_CM * POINTS_PER_CM
    maximumHeight = MAX_PHOTO_HEIGHT_CM * POINTS_PER_CM
    If picture.Width > maximumWidth Then picture.Width = maximumWidth
    If picture.Height > maximumHeight Then picture.Height = maximumHeight
    doc.Bookmarks.Add bookmarkName, picture.Range
    If Not doc.Bookmarks.Exists(bookmarkName) Then
        Err.Raise vbObjectError + 5035, , _
            "Photo bookmark was not restored."
    End If
    If doc.Bookmarks(bookmarkName).Range.InlineShapes.Count <> 1 Then
        Err.Raise vbObjectError + 5036, , _
            "Photo bookmark does not contain one embedded picture."
    End If
End Sub

Private Sub RequireRowUnchanged(ByVal ws As Worksheet, _
                                ByVal excelRow As Long, _
                                ByRef data As Variant, _
                                ByVal dataRow As Long)
    Dim columnIndex As Long
    Dim currentValue As Variant
    Dim originalValue As Variant

    For columnIndex = 1 To 13
        currentValue = ws.Cells(excelRow, columnIndex).Value2
        originalValue = data(dataRow, columnIndex)
        If Not VariantValuesExactlyEqual(originalValue, currentValue) Then
            Err.Raise vbObjectError + 5037, , _
                "Excel row " & excelRow & " changed after preflight. " & _
                "Run the batch again."
        End If
    Next columnIndex
End Sub

Private Function VariantValuesExactlyEqual(ByVal firstValue As Variant, _
                                            ByVal secondValue As Variant) As Boolean
    If IsError(firstValue) Or IsError(secondValue) Then
        Exit Function
    End If
    If VarType(firstValue) <> VarType(secondValue) Then Exit Function
    VariantValuesExactlyEqual = _
        (StrComp(CStr(firstValue), CStr(secondValue), vbBinaryCompare) = 0)
End Function

Private Function CreateRunFolder(ByVal fso As Object, _
                                 ByVal outputRoot As String) As String
    Dim baseFolder As String
    Dim candidate As String
    Dim suffix As Long

    baseFolder = "Run_" & Format$(Now, "yyyymmdd_hhnnss")
    candidate = JoinPath(outputRoot, baseFolder)
    Do While fso.FolderExists(candidate)
        suffix = suffix + 1
        candidate = JoinPath(outputRoot, baseFolder & "_" & _
            Format$(suffix, "000"))
    Loop
    fso.CreateFolder candidate
    CreateRunFolder = candidate
End Function

Private Sub EnsureFolder(ByVal folderPath As String)
    If FolderExistsStrict(folderPath) Then Exit Sub
    On Error GoTo CreateFailed
    MkDir folderPath
    Exit Sub
CreateFailed:
    Err.Raise vbObjectError + 5038, , _
        "Could not create folder: " & folderPath & ". " & Err.Description
End Sub

Private Sub RequireFolder(ByVal folderPath As String, _
                          ByVal folderLabel As String)
    If Not FolderExistsStrict(folderPath) Then
        Err.Raise vbObjectError + 5039, , _
            "Missing " & folderLabel & ": " & folderPath
    End If
End Sub

Private Sub RequireTargetAbsent(ByVal filePath As String)
    If FileExistsStrict(filePath) Then
        Err.Raise vbObjectError + 5040, , _
            "Refusing to overwrite existing file: " & filePath
    End If
End Sub

Private Sub RequireNonemptyFile(ByVal filePath As String, _
                                ByVal fileLabel As String)
    If Not FileExistsStrict(filePath) Then
        Err.Raise vbObjectError + 5041, , _
            "Missing " & fileLabel & ": " & filePath
    End If
    On Error GoTo SizeFailed
    If FileLen(filePath) <= 0 Then
        Err.Raise vbObjectError + 5042, , _
            "Empty " & fileLabel & ": " & filePath
    End If
    Exit Sub
SizeFailed:
    If Err.Number >= vbObjectError + 5041 And _
       Err.Number <= vbObjectError + 5042 Then
        Err.Raise Err.Number, , Err.Description
    End If
    Err.Raise vbObjectError + 5043, , _
        "Could not inspect " & fileLabel & ": " & filePath & _
        ". " & Err.Description
End Sub

Private Function FileExistsStrict(ByVal filePath As String) As Boolean
    Dim resultText As String

    On Error GoTo CheckFailed
    resultText = Dir$(filePath, vbNormal Or vbHidden Or vbSystem Or vbReadOnly)
    FileExistsStrict = (Len(resultText) > 0)
    Exit Function
CheckFailed:
    Err.Raise vbObjectError + 5044, , _
        "Could not check file path: " & filePath & ". " & Err.Description
End Function

Private Function FolderExistsStrict(ByVal folderPath As String) As Boolean
    Dim resultText As String

    On Error GoTo CheckFailed
    resultText = Dir$(folderPath, vbDirectory)
    If Len(resultText) = 0 Then
        FolderExistsStrict = False
    Else
        FolderExistsStrict = _
            ((GetAttr(folderPath) And vbDirectory) = vbDirectory)
    End If
    Exit Function
CheckFailed:
    Err.Raise vbObjectError + 5045, , _
        "Could not check folder path: " & folderPath & ". " & Err.Description
End Function

Private Function JoinPath(ByVal parentPath As String, _
                          ByVal childName As String) As String
    If Right$(parentPath, 1) = "\" Then
        JoinPath = parentPath & childName
    Else
        JoinPath = parentPath & "\" & childName
    End If
End Function

Private Function ContainsControlCharacter(ByVal valueText As String) As Boolean
    Dim characterIndex As Long
    Dim characterCode As Long

    For characterIndex = 1 To Len(valueText)
        characterCode = AscW(Mid$(valueText, characterIndex, 1))
        If characterCode >= 0 And characterCode <= 31 Then
            ContainsControlCharacter = True
            Exit Function
        End If
    Next characterIndex
End Function

Private Function IsReservedWindowsName(ByVal baseName As String) As Boolean
    Dim upperName As String
    Dim suffixText As String
    Dim suffixCode As Long

    upperName = UCase$(baseName)
    Select Case upperName
        Case "CON", "PRN", "AUX", "NUL", "CLOCK$"
            IsReservedWindowsName = True
            Exit Function
    End Select
    If Len(upperName) >= 4 Then
        If Left$(upperName, 3) = "COM" Or Left$(upperName, 3) = "LPT" Then
            suffixText = Mid$(upperName, 4)
            If Len(suffixText) = 1 Then
                suffixCode = AscW(suffixText)
                If (suffixCode >= AscW("1") And suffixCode <= AscW("9")) Or _
                   suffixText = ChrW$(&HB9) Or _
                   suffixText = ChrW$(&HB2) Or _
                   suffixText = ChrW$(&HB3) Then
                    IsReservedWindowsName = True
                End If
            End If
        End If
    End If
End Function

The example uses Word’s documented inline picture insertion, DOCX saving, and PDF export.

Review each generated pack before client release

Identity and recipient

Match PackID, client name, listing reference, property address, intended recipient, and distribution purpose.

Facts and price

Confirm the asking price display, property facts, summary wording, availability, inclusions, exclusions, and any time-sensitive statements.

Photograph and caption

Verify that the image shows the correct property, orientation is usable, the caption is accurate, and no sensitive detail is exposed.

Brand and agent

Check the approved logo, agent name, contact block, required office details, and any authorization or licensing wording.

DOCX and PDF

Open both files and inspect page breaks, tables, headers, footers, image scaling, fonts, blank fields, links, and metadata.

Disclosure and release

Apply the appropriate legal, regulatory, brokerage, privacy, accessibility, approval, retention, and delivery controls outside the macro.

Know what the free example does not guarantee

No listing verification

The macro does not verify ownership, status, price, measurements, condition, availability, or the truth of spreadsheet content.

No image authenticity proof

It does not decode images, validate capture metadata, identify the property, or prove editing history and usage rights.

No cryptographic snapshot

Size and modification-time checks detect ordinary changes but do not provide a hash or signed chain of custody.

No atomic file-and-status commit

DOCX, PDF, and Excel status updates are separate operations. Reconcile the retained run folder after an interruption.

No concurrent-writer protection

Use one writer per output location or add external coordination; existence checks cannot eliminate every race.

No automatic approval

DONE records generation and a saved status, not legal, commercial, brokerage, brand, or client approval.

Run a representative pack pilot before production

Use obvious test records

Create six disposable listings with visibly different PackID, address, price text, summary, and photograph.

Stress the layout

Test long addresses, long summaries, portrait and landscape images, missing optional logos, and captions that wrap.

Test status handling

Include READY, HOLD, and DONE rows and confirm that only READY rows generate documents.

Test blocked targets

Place a disposable existing file in a target location and confirm that the macro refuses to overwrite it.

Test source stability

Change a disposable source during a run and confirm the snapshot isolates later outputs from that change.

Review away from the source

Copy completed DOCX/PDF files elsewhere and confirm that embedded property images and logos remain visible.

Exit criteria

Approve the workflow only when every identifier, address, price, summary, image, caption, agent block, DOCX, and PDF matches the reviewed source and the exception tests stop safely.

Use Factory for repeatable real estate client-pack batches

DocxForge Pro Factory maps many reviewed Excel rows to one standard Word template and creates a separate output for each row. That is the architecture used here.

Where Factory fits

Use it when every listing uses the same multi-section client-pack template. If one property case needs several different documents from different templates, use Contractor instead.

DocxForge Pro Factory Excel data screen for real estate client pack rows
Review listing rows, display values, and mapped client-pack fields.
DocxForge Pro Factory documents screen for one real estate client pack template
Confirm the standard template and separate outputs for the batch.
Generate standardized real estate client packs with Factory7 days free, then $38 every 3 months • 14-day refund after purchase.
Many listing rowsOne pack templateSeparate DOCX/PDFLocal processing
Start Free 7-Day Trial

Frequently asked questions

Is this a Factory workflow even though the output is called a client pack?

Yes. Each READY row uses the same multi-section Word template and produces one client-pack DOCX/PDF pair. The word pack describes the sections inside one document, not several different templates.

Which rows must be fully completed?

READY rows need the complete A–M contract. HOLD and DONE rows still need an exact, unique PackID and a valid PackStatus. If they contain OutputName, it must also be safe and unique.

Can PropertySummary contain several paragraphs?

Yes. Store it as text with ordinary line breaks. The macro normalizes CRLF, LF, and CR for Word and rejects a summary made only of spaces or line breaks.

Does the macro preserve the checked template and images during the run?

It creates run-specific copies of the Word template, property photographs, and optional agent logos, then generates every document from those copies. Size and modification-time checks are useful controls, but they are not cryptographic proof of file identity.

Does DONE mean the client pack is approved for a buyer or seller?

No. DONE confirms that the generated files were created and the workbook status was saved. A person must still verify the property facts, price, photograph, disclosures, branding, metadata, layout, and permitted recipient before release.

When should Contractor be used instead?

Use Contractor when one property or client case needs several different documents from different templates, such as a brochure, offer cover letter, viewing checklist, and disclosure pack. Use Factory for many listing rows using one standard client-pack template.

Turn reviewed listing rows into consistent client-pack documentsUse one standard Word template locally. 7 days free, then $38 every 3 months • 14-day refund.
Factory workflowEmbedded imagesEditable DOCXFinal PDF
Start Free 7-Day Trial