sandy
Thu Feb 16 16:34:31 CST 2006
Thanks very much for your help. I tried every combination I could think of
with INCLUDEPICTURE, even putting the field into the access table and linking
the word file, without success.
In the end I've added this code to the access subroutine and it works!
With Selection.Find
.Text = "Mr A Hodge"
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.HomeKey Unit:=wdLine
Selection.MoveUp Unit:=wdLine, Count:=2
If fDear Then 'Address by first name
Selection.InlineShapes.AddPicture FileName:= _
strDocsPath & "alan.jpg" _
, LinkToFile:=False, SaveWithDocument:=True
Else
Selection.InlineShapes.AddPicture FileName:= _
strDocsPath & "alanhodge.jpg" _
, LinkToFile:=False, SaveWithDocument:=True
End If
"Peter Jamieson" wrote:
> A possible problem wth your code is that isnull("") is False, i.e. an empty
> string is not the same as a null string.
>
> The Signature property needs to contain the pathname with doubled-up
> backslashes
>
> The Includepicture field needs to be like
>
> { INCLUDEPICTURE "{ DOCPROPERTY Signature }" }
>
> where both pairs of {} are the sort you can insert using ctrl-F9, not the
> ordinary ones on the keyboard
>
> You will /may/ need to set
>
> myWordApplication.Options.UpdateFieldsAtPrint = True
>
> and/or
>
> myWordApplication.Options.UpdateLinksAtPrint = True
>
> (I've never quite worked out which)
>
> and if you are outputting to a new document, you may /also/ need to select
> the document and re-execute all the INCLUDEPICTURE field codes (or all the
> field codes, whichever is the simpler)
>
> Peter Jamieson
>
> "Sandy" <sandy@discussions.microsoft.com> wrote in message
> news:F22FEA95-EB95-4715-96C2-A60823DAC09A@microsoft.com...
> > Peter/Graham
> >
> > Thanks for your help. I manually inserted {IncludePicture
> > "C:\\FilePath\\AlanHodge.jpg"} and this signature file was inserted and
> > displayed in every case (which is considerable progress!), but also when I
> > had intended that "Alan.jpg" should be inserted. My code in Access is
> >
> > If Not IsNull(strSalutation) Then
> > strSalutation = ctl.Column(12, varValue) 'In a multiselect box
> > strSig = "C:\FilePath\Alan.jpg"
> > Else
> > strSalutation = ctl.Column(6, varValue) & _
> > " " & ctl.Column(2, varValue) 'Title and surname
> > strSig = "C:\FilePath\alanhodge.jpg"
> > End If
> > ...
> > prps.Item("Signature").Value = strSig
> >
> > How can I make Access recognise the Signature doc property and insert the
> > correct link?
> >
> > Sandy
> > "Graham Mayor" wrote:
> >
> >> The alternative is to create autotext entries of the inserted images and
> >> insert those as required using AUTOTEXT fields.
> >> The process is essentially that at
> >>
http://www.gmayor.com/mail_merge_graphics.htm
> >> or
http://www.gmayor.com/SelectFile.htm
> >>
> >> --
> >> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >> Graham Mayor - Word MVP
> >>
> >> My web site www.gmayor.com
> >> Word MVP web site
http://word.mvps.org
> >> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >>
> >> Sandy wrote:
> >> > I have a routine that creates a standard letter to a variety of
> >> > people. The routine uses a Word template that contains doc properties
> >> > to receive the content of fields such as "name", "address",
> >> > "Todaydate" etc. At the end of the routine, the fields are unlinked.
> >> >
> >> > I would like to insert a signature .jpg file that would vary
> >> > according to whether I have addressed the recipient by their first
> >> > name or their title and surname. I have experimented with
> >> > INSERTPICTURE, but only managed to create an empty graphic box. Is
> >> > there a work round? Help gratefully received.
> >>
> >>
> >>
>
>
>