includepicture field problem

Hi

I´m using the includetext field and includepicture field in my documents so that I can be sure that I´m using the latest data. It's a lot of files and in the end of the process we put them all together to one document. And that is when I get problems, when I copy a includetext fieldd from one document to another it all works great. But when I copy the includepicture field the field disapears and only the picture is there, the field with the link disapears. Is this a bug?

/Lina

Answer
Answer

Whether it is a bug or 'by design' is difficult to say. Word 2010 has many changes to graphics handling and this appears to be one of them. All however is not lost. Display the field codes. Put your cursor in the field you want to copy and run the first macro.

Move to where you want the image and run the second macro. The field will be recreated at that location. See http://www.gmayor.com/installing_macro.htm   

Sub CopyField()
Dim oRng As Range
    If ActiveWindow.View.ShowFieldCodes = False Then
        MsgBox "Display fields and insert the cursor in the field before copying."
        Exit Sub
    End If
    Set oRng = Selection.Range
    oRng.MoveStartUntil Chr(19), wdBackward
    oRng.Start = oRng.Start
    oRng.MoveEndUntil Chr(21)
    oRng.End = oRng.End - 2
    oRng.Copy
End Sub

Sub PasteField()
Dim oFld As Field
Dim oRng As Range
Dim DataObj As New DataObject
Dim strCode As String
    ActiveWindow.View.ShowFieldCodes = True
    Set oRng = Selection.Range
    DataObj.GetFromClipboard
    strCode = DataObj.GetText
    Set oFld = ActiveDocument.Fields.Add(oRng, wdFieldEmpty, False)
    oFld.Code.Text = Replace(oFld.Code.Text, oFld.Code.Text, strCode)
    oFld.Update
    ActiveWindow.View.ShowFieldCodes = False
End Sub

Graham Mayor (Microsoft Word MVP 2002-2019)
For more Word tips and downloads visit my web site
https://www.gmayor.com/Word_pages.htm

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Answer
Answer
INCLUDEPICTURE fields are not displayed in Word 2010 (*.docx) files. If you save the document in Word 97-2003 (*.doc) format, you will be able to see the field code provided the picture is In Line With Text. The field code will still not be displayed if the picture is wrapped.
Microsoft MVP (Word) since 1999
Fairhope, Alabama USA
http://ssbarnhill.com
http://wordfaqs.ssbarnhill.com
Screen shots captured with TechSmith's Snagit

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated April 14, 2025 Views 1,463 Applies to: