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 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -