image - Regex for a Microsoft Word search -
i editing large book document lot of picture. have number of sections in text fields similar this:
{includepicture "c:\\book\\nikond5500\\chapter_1-129.jpg" \d}
i trying run regex find , copy find phrase between 2 curly bracket {} , paste in other document. ideally need picture names "chapter_1-129.jpg" (and on) list.
you can run simple vba macro iterates fields in document this:
option explicit sub listimagefields() dim ofield field dim odocsource document dim odoctarget document dim result string each ofield in activedocument.fields if ofield.type = wdfieldincludepicture result = result & getpicturesourcefromfieldcode(ofield.code) & vbcrlf end if next set odoctarget = documents.add odoctarget.range.text = result end sub function getpicturesourcefromfieldcode(byval fieldcode string) string dim startindex integer dim endindex integer startindex = instr(fieldcode, """") + 1 endindex = instrrev(fieldcode, """") getpicturesourcefromfieldcode = mid(fieldcode, startindex, endindex - startindex) end function