Do lngPos = InStr(1, strMemo, "@PURCHASEORDERID", vbTextCompare) If lngPos = 0 Then Exit Do End If strMemo = Mid(strMemo, 1, lngPos - 1) & _ mobjPurchaseOrder.PurchaseOrderID & _ Mid(strMemo, lngPos + 16) LoopAs you can see, it loop thru the string and replaces the string as needed. This works for one but what if I want to check every property in my object for existance of the matching tag string and do a similar replace? Is there a cool way to do this w/o hard-coding the strings to lookup?
For Each Property In mobjPurchaseOrder.Properties lngPos = InStr(1, strMemo, "@" & Property.Name, vbTextCompare) If lngPos = 0 Then Exit Do End If intLen = Len(Property.Name) strMemo = Mid(strMemo, 1, lngPos - 1) & _ Property.Value & _ Mid(strMemo, lngPos + intLen) Next