Prev: Curved lines in Word?
Next: Shift N causes line return
From: Jay Freedman on 1 Feb 2010 14:56 Peter, The information is available through VBA. I posted a macro at http://groups.google.com/group/microsoft.public.word.newusers/msg/8a69e37ddeec4c2f to display the link for a selected Shape or InlineShape. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. Peter Jamieson wrote: >> 2) Shift+F9 does not work to see link. > > Unless your .docx/.docm is in compatibility mode, or you inserted your > picture in a very specific way (see below at ***), I do not believe > that Word 2007 .docx/.docm files retain INCLUDEPICTURE fields at all, > even when you originally inserted the picture using > a. an INCLUDEPICTURE field or > b. using insert->picture->insert and link to file (which creates an > INCLUDEPICTURE field in Word 2003, but not in a .docx in Word 2007) > > IN cases where you have a linked picture, but where Word has lost the > INCLUDEPICTURE field, Word actually represents the link in a > completely different way, using: > a. a "relationship" that specifies the pathname of the image file. > b. a copy of the image, renamed, inside a "media" folder within the > .docx - e.g. it may be named image1.jpeg > c. a relationship that specifies that image's pathname within the > .docx. > The problem is that as far as I can tell, even though the link > information is present in the .docx/.docm file, > d. these links are not regarded as the kind of links that appear in > the "Edit Links" dialog > e. you can't access this information using Word VBA and the "Word > Object Model" > f. it is not obvious how you would access the information while the > document was open. > > That said, if you need to know the original path, but you simply > cannot get Word to display an INCLUDEPICTURE field, you /may/ be able > to get the information as follows: > a. save the document using Word 2007 .xml format (Office button->Save > As->Other formats, then select "Save As Type" Word XML Document. > b. open the .xml file using Notepad, or using Word if you know how to > open it as a plain text file, > c. use "find" to look for "w:drawing" . You should find something > like >> <w:drawing><wp:inline distT="0" distB="0" distL="0" > distR="0"><wp:extent cx="5724525" cy="4295775"/><wp:effectExtent > l="19050" t="0" r="9525" b="0"/><wp:docPr id="1" name="Picture 1" > descr="C:\Users\Public\Pictures\Sample Pictures\Creek.jpg"/> > > You can see that the picture pathname is recorded in there. However, > that is as far as I can lead you: if there are multiple > pictures/graphic objects, I cannot currently tell you an easy way to > determine which picture is linked to which file. It should be > possible to write some VBA or XSLT to get more useful information out > of the .xml file, but I haven't tried that yet. > > For anyone else reading this who would like to take it a little > further, it may be worth knowing that the "wp" prefix used in the > .xml file is not declared anywhere in the .xml - in other words, it's not > valid > XML. However, that might not prevent code that relies on an XML parser > (either VBA or XSLT) from succeeding. > > Maybe I'll get around to doing more myself at some point. > > ***As far as I know, the only approach that will actually insert an > INCLUDEPICTURE field into a .docx/.docm that is not a compatibility > mode file is to insert the field code manually, e.g. insert { } using > ctrl-F9, then type the field code text inside, e.g. so you have > { INCLUDEPICTURE "c::\\mypictures\\mypicture.jpg" } > > Then select and update the field. /That/ field code should survive > Save/Close/Open as a .docx file, even when you do not select > compatibility mode. > > > Peter Jamieson > > http://tips.pjmsn.me.uk > > On 01/02/2010 09:29, Sevilho wrote: >> Graphic file is linked. But >> 1) it can be seen only in page layout (in Word 2003 I can see it in >> Normal mode) >> 2) Shift+F9 does not work to see link. >> >> Is it right? Is any method to see the picture in Normal mode ?
From: Peter Jamieson on 1 Feb 2010 16:01 Thanks Jay. You are right. Funny, I was definitely encountering picture objects with no such info. Probably experimental error on my part, but I'll try to go through the tests again at some point when I'm not so bog-eyed. However, I am still reasonably sure that the actual INCLUDEPICTURE fields themselves are being removed and replaced by the other link information I described, and I am reasonably sure that Word never regenerates INCLUDEPICTURE fields from that newer-style link information. Peter Jamieson http://tips.pjmsn.me.uk On 01/02/2010 19:56, Jay Freedman wrote: > Peter, > > The information is available through VBA. I posted a macro at > http://groups.google.com/group/microsoft.public.word.newusers/msg/8a69e37ddeec4c2f > to display the link for a selected Shape or InlineShape. >
From: Jay Freedman on 1 Feb 2010 20:28 Yes, that's correct -- the information is in the object's LinkFormat property, but there is no INCLUDEPICTURE field. Any code from previous Word versions that depends on reading or modifying the INCLUDEPICTURE field code (for example, replacing the path in the file name) will fail. The interesting part is that if you use File > SaveAs to save the document in Word 2003 format, it "magically" reconstitutes the INCLUDEPICTURE field. The part I really don't understand is why the dev team felt they had to mess with this. "Who knows what evil lurks..." -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. On Mon, 01 Feb 2010 21:01:55 +0000, Peter Jamieson <pjj(a)KillMAPSpjjnet.demon.co.uk> wrote: >Thanks Jay. You are right. > >Funny, I was definitely encountering picture objects with no such info. >Probably experimental error on my part, but I'll try to go through the >tests again at some point when I'm not so bog-eyed. > >However, I am still reasonably sure that the actual INCLUDEPICTURE >fields themselves are being removed and replaced by the other link >information I described, and I am reasonably sure that Word never >regenerates INCLUDEPICTURE fields from that newer-style link information. > >Peter Jamieson > >http://tips.pjmsn.me.uk > >On 01/02/2010 19:56, Jay Freedman wrote: >> Peter, >> >> The information is available through VBA. I posted a macro at >> http://groups.google.com/group/microsoft.public.word.newusers/msg/8a69e37ddeec4c2f >> to display the link for a selected Shape or InlineShape. >>
From: Peter Jamieson on 2 Feb 2010 09:27 Yes, the regeneration of INCLUDEPICTURE fields is interesting. At first I thought it only happened when the INCLUDEPICTURE field itself (rather than the link info.) was retained. (I think I must have broken some links inadvertently when I was looking at this, and that pictures that I thought should be linked no longer were. Oh well.) > The part I really don't understand is why the dev team felt they had > to mess with this. "Who knows what evil lurks..." As usual it's easy to think of a number of reasons, but which ones actually drove the whole thing is anyone's guess. Peter Jamieson http://tips.pjmsn.me.uk On 02/02/2010 01:28, Jay Freedman wrote: > Yes, that's correct -- the information is in the object's LinkFormat > property, but there is no INCLUDEPICTURE field. Any code from previous > Word versions that depends on reading or modifying the INCLUDEPICTURE > field code (for example, replacing the path in the file name) will > fail. > > The interesting part is that if you use File> SaveAs to save the > document in Word 2003 format, it "magically" reconstitutes the > INCLUDEPICTURE field. > > The part I really don't understand is why the dev team felt they had > to mess with this. "Who knows what evil lurks..." > > -- > Regards, > Jay Freedman > Microsoft Word MVP FAQ: http://word.mvps.org > Email cannot be acknowledged; please post all follow-ups to the > newsgroup so all may benefit. > > On Mon, 01 Feb 2010 21:01:55 +0000, Peter Jamieson > <pjj(a)KillMAPSpjjnet.demon.co.uk> wrote: > >> Thanks Jay. You are right. >> >> Funny, I was definitely encountering picture objects with no such info. >> Probably experimental error on my part, but I'll try to go through the >> tests again at some point when I'm not so bog-eyed. >> >> However, I am still reasonably sure that the actual INCLUDEPICTURE >> fields themselves are being removed and replaced by the other link >> information I described, and I am reasonably sure that Word never >> regenerates INCLUDEPICTURE fields from that newer-style link information. >> >> Peter Jamieson >> >> http://tips.pjmsn.me.uk >> >> On 01/02/2010 19:56, Jay Freedman wrote: >>> Peter, >>> >>> The information is available through VBA. I posted a macro at >>> http://groups.google.com/group/microsoft.public.word.newusers/msg/8a69e37ddeec4c2f >>> to display the link for a selected Shape or InlineShape. >>>
From: Miles on 3 Feb 2010 12:39
Microsoft support confirmed that this is a bug around mid-December '09. After some confirmatory testing, they seemed rather shocked to discover that not all support issues are user errors! > As usual it's easy to think of a number of reasons, but which ones > actually drove the whole thing is anyone's guess. Nasty 'ol neglect, apparently. They did some research and determined that their developers' test suite doesn't even include IncludePicture tests! This makes sense since IncludePicture has been quietly deprecated in 2007 -- searching for IncludePicture in Word Help comes up rather empty these days. Microsoft obviously want their badly-flawed IncludePicture feature to just fade away. At any rate, they've promised a fix in SP3 which they say is due sometime around March, so I'd wait until then before investing a lot into finding a workaround. "Peter Jamieson" wrote: > Yes, the regeneration of INCLUDEPICTURE fields is interesting. At first > I thought it only happened when the INCLUDEPICTURE field itself (rather > than the link info.) was retained. (I think I must have broken some > links inadvertently when I was looking at this, and that pictures that I > thought should be linked no longer were. Oh well.) > > > The part I really don't understand is why the dev team felt they had > > to mess with this. "Who knows what evil lurks..." > > As usual it's easy to think of a number of reasons, but which ones > actually drove the whole thing is anyone's guess. > > Peter Jamieson > > http://tips.pjmsn.me.uk > > On 02/02/2010 01:28, Jay Freedman wrote: > > Yes, that's correct -- the information is in the object's LinkFormat > > property, but there is no INCLUDEPICTURE field. Any code from previous > > Word versions that depends on reading or modifying the INCLUDEPICTURE > > field code (for example, replacing the path in the file name) will > > fail. > > > > The interesting part is that if you use File> SaveAs to save the > > document in Word 2003 format, it "magically" reconstitutes the > > INCLUDEPICTURE field. > > > > The part I really don't understand is why the dev team felt they had > > to mess with this. "Who knows what evil lurks..." > > > > -- > > Regards, > > Jay Freedman > > Microsoft Word MVP FAQ: http://word.mvps.org > > Email cannot be acknowledged; please post all follow-ups to the > > newsgroup so all may benefit. > > > > On Mon, 01 Feb 2010 21:01:55 +0000, Peter Jamieson > > <pjj(a)KillMAPSpjjnet.demon.co.uk> wrote: > > > >> Thanks Jay. You are right. > >> > >> Funny, I was definitely encountering picture objects with no such info. > >> Probably experimental error on my part, but I'll try to go through the > >> tests again at some point when I'm not so bog-eyed. > >> > >> However, I am still reasonably sure that the actual INCLUDEPICTURE > >> fields themselves are being removed and replaced by the other link > >> information I described, and I am reasonably sure that Word never > >> regenerates INCLUDEPICTURE fields from that newer-style link information. > >> > >> Peter Jamieson > >> > >> http://tips.pjmsn.me.uk > >> > >> On 01/02/2010 19:56, Jay Freedman wrote: > >>> Peter, > >>> > >>> The information is available through VBA. I posted a macro at > >>> http://groups.google.com/group/microsoft.public.word.newusers/msg/8a69e37ddeec4c2f > >>> to display the link for a selected Shape or InlineShape. > >>> > . > |