Results 1 to 5 of 5
  1. #1

    How do I find the file name of an embedded picture (Latest)

    Subject line says it all. I have a 400 page document, and am tasked with reducing the size (almost 6 meg). Almost all of the pictures are in .png format, and they are all in color (around 200 in all). I have taken the picture files and converted them to grayscale, but do not want to sort thru over 200 screen shots to find the ones I need individually. Is there a way to find the name of a graphic already embedded into a WORD 2000 document? I mean, we have to enter the file name of the picture when we insert it; one would think that the name is stored by word somewhere...

  2. #2
    5 Star Lounger
    Join Date
    Dec 2000
    Tallahassee, Florida, USA
    Thanked 0 Times in 0 Posts

    Re: How do I find the file name of an embedded picture (Latest)

    Hi, Wordsmith2000!

    <img src=/S/yep.gif border=0 alt=yep width=15 height=15> Alt+F9 toggles between viewing field codes and code results. Embedded objects (such as graphics) are in fields. One thing which will greatly reduce the size of your file (I've seen 4 mg files reduced to about 400K using this technique) -- Select and copy the graphic. Then delete the existing graphic and use Edit / Paste Special / and select either "Picture" or "Device Independent Bitmap".


  3. #3
    Platinum Lounger
    Join Date
    Dec 2000
    Queanbeyan, New South Wales, Australia
    Thanked 0 Times in 0 Posts

    Re: How do I find the file name of an embedded picture (Latest)


    I'd like this solution (Alt+F9 to display an embedded graphic name) to work, as it would be useful to me too. But, if I insert a picture into a document (Insert, Picture, From file- and leave "Indert" selected rather than "Link to file" or "Insert and link", I only get the picture, and not a field code.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Silicon Valley, USA
    Thanked 93 Times in 89 Posts

    Re: How do I find the file name of an embedded picture (Latest)

    If you open your file using "Recover Text From Any File" you may well find the paths stored in the metadata, inaccessible via normal methods. In the case of two files I checked, both contained the name of the source graphic file, one with a complete path, and the other with just the name (although both can be found in the same folder as the documents, so...). These were both .gif files, which might be handled differently than the "native" .bmp format.

    Unfortunately, the goop that inhabits the metadata areas of Word files probably would be so difficult to cleanly parse that you would spend more time programming than would be warranted. Unless, of course, it helps all your fellow loungers in the future. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    On second thought, this is one big file, and you don't need to parse it interactively, you really just need a list in the proper sequence. Try opening using Recover Text..., and using this crusty old "scavenger" macro (specifying .png) and see what happens:

    Rem jfsUtils:jfsScavengeFile
    'Based on xGutBillingFile [which was based on xGutTable] as of 2/28/95
    'Copyright 1997 Jefferson F. Scher
    'Created 07/28/97; fixed a bit 08/13/97

    <pre>Public Sub MAIN()
    Dim ans
    Dim SearchStr$
    Dim ParaTrue
    Dim PositionVal
    Rem Get text to Find, and column no to find it in
    WordBasic.BeginDialog 370, 136, "Line or Paragraph Scavenger"
    WordBasic.Text 29, 16, 323, 13, "Text to find in lines or paragraphs to copy:"
    WordBasic.TextBox 31, 34, 316, 18, "SrchStrng"
    WordBasic.GroupBox 31, 58, 190, 59, " What to save "
    WordBasic.OptionGroup "WhatToSave"
    WordBasic.OptionButton 41, 74, 159, 16, "Save &Paragraphs" '0
    WordBasic.OptionButton 41, 91, 149, 16, "Save &Lines only" '1
    WordBasic.OKButton 252, 65, 88, 21
    WordBasic.CancelButton 252, 90, 88, 21
    Dim dlg As Object: Set dlg = WordBasic.CurValues.UserDialog
    ans = WordBasic.Dialog.UserDialog(dlg)
    If ans = 0 Then GoTo bye
    SearchStr$ = dlg.SrchStrng
    ParaTrue = dlg.WhatToSave - 1

    Rem Search loop; start from top of document; mark end of search area
    WordBasic.StartOfDocument 'Position insertion point at top
    If Not WordBasic.ExistingBookmark("StopHere") Then 'Need to have ending point for search
    WordBasic.EndOfDocument: WordBasic.InsertPara: WordBasic.InsertPara
    WordBasic.InsertPara: WordBasic.LineUp 2 'insert returns at end
    WordBasic.EditBookmark "StopHere" 'Insert end point for search
    WordBasic.StartOfDocument 'rePosition insertion point at top
    End If

    WordBasic.WW2_EditFind Find:=SearchStr$, WholeWord:=0, MatchCase:=0, Direction:=2, Format:=0
    If Not WordBasic.EditFindFound() Then 'This should never happen, unless string is bad
    WordBasic.MsgBox "Done! No more ''" + SearchStr$ + "'' to be found in this file...", 48
    GoTo bye
    End If
    PositionVal = WordBasic.CmpBookmarks("sel", "StopHere")
    If PositionVal <> 1 Then 'Not past bookmark
    If ParaTrue Then 'position insertion point at
    WordBasic.ParaUp 'start of paragraph w/srch term
    WordBasic.StartOfLine 'start of line w/srch term
    End If
    WordBasic.StartOfDocument 1 'Select to start of doc
    If WordBasic.SelType() = 2 Then WordBasic.EditClear 'Del selection (not next character)
    If ParaTrue Then 'select
    WordBasic.ParaDown 1, 1 'paragraph w/srch term
    WordBasic.EndOfLine 1 'line w/srch term and end para
    End If
    WordBasic.EditCut 'put in on the clipboard
    WordBasic.EndOfDocument 'goto end of document
    WordBasic.EditPaste 'paste the cut line
    WordBasic.StartOfDocument 'go back up and keep on moving
    WordBasic.WW7_EditGoTo "StopHere" 'backup to end mark
    WordBasic.StartOfDocument 1 'Select to start of doc
    WordBasic.EditClear 'Delete selection
    WordBasic.MsgBox "Done! No more ''" + SearchStr$ + "'' to be found in this file...", 48
    GoTo bye
    End If
    GoTo LookUp

    End Sub</pre>

    That code isn't pretty, but I did a dry run on one of my docs and it still works (Word2000).

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Melbourne, Victoria, Australia
    Thanked 0 Times in 0 Posts

    Re: How do I find the file name of an embedded picture (Latest)

    You're right about the "Edit/Paste special" (Picture) trick.
    It does reduce the document size enormously without degrading the print quality of the result.
    But, is there some utility that will scan the whole finished document and transform it into the reduced version automatically? As this would seem to be a common task perhaps there is some VBA procedure someone has written to do this?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts