I am intending adding photos to word from MS access code. Your code
Code
-------------------
ActiveDocument.Fields.Add _
Range:=Selection.Range, _
Type:=wdFieldIncludePicture, _
Text:=wdQuote & strFN & wdQuote, _
preserveformatting:=False
-------------------
works, however it is adding a field to my template which is not what
intended to do.
> If you mean that you want to have the field include one picture now
> and change that (in the same document) to a different picture later,
> that's another story... then you want to display field codes and do a
> find/replace of the old filename with the new one.
>
Defines exactly what I want to do.
I have an existing picture acting as marker in my document, it i
inserted as an includepicture field. This is the field that I want t
update with a picture from code. I have attempted searching for hel
on this and have failed to find relevant references. The closest i
your post. Can you help please
Doug Robbins - Word MVP - 01 Jan 2006 11:15 GMT
Try adding a line
Selection.Range.Fields(1).Unlink
Or to add a picture to a document, you can use:
.Range.InlineShapes.AddPicture Filename:=strFN

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> I am intending adding photos to word from MS access code. Your code
>
[quoted text clipped - 23 lines]
> on this and have failed to find relevant references. The closest is
> your post. Can you help please?
dynamictiger - 01 Jan 2006 21:43 GMT
Thanks for your advice.
Selection.Range.Fields(1).Unlink - Is giving me an error on the wor
merge field doc and the the other doc I have set up without a field.
The error is "Not part of the collection".
.Range.InlineShapes.AddPicture Filename:=strFN - Works fine but i
still placing the picture at the top of the document not in th
predetermined picture box.
Is there something I am missing on the word side
Doug Robbins - Word MVP - 02 Jan 2006 04:47 GMT
You need to make a reference to the .Range into which you want the picture
to be inserted.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Thanks for your advice.
>
[quoted text clipped - 7 lines]
>
> Is there something I am missing on the word side?