Connecting Tech Pros Worldwide Help | Site Map

Running Wod from Access

Dave Griffiths
Guest
 
Posts: n/a
#1: Nov 13 '05
I currently use Automation to send text to Word Templates from an
Access 97 application - using bookmarks to place the text where I want
it.

My question is - is it also possible to send an image, and if so, how?

TIA
Dave
Dan Morgan
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Running Wod from Access


dave@k2computers.co.uk (Dave Griffiths) wrote in message news:<56242347.0410280346.4a246b11@posting.google. com>...[color=blue]
> I currently use Automation to send text to Word Templates from an
> Access 97 application - using bookmarks to place the text where I want
> it.
>
> My question is - is it also possible to send an image, and if so, how?
>
> TIA
> Dave[/color]

Something I use in vbscript (easily adaptable to vba) to add a
signature to letter on install to the workstation. Should at least
set you in the right direction.


dim appWrd
dim docWrd
dim rngWrd

set AppWrd = wscript.createobject("word.application")

set docWrd = appWrd.documents.open("PathToTemplate")

docWrd.unprotect

set rngWrd = docWrd.bookmarks("signature").range

docWrd.inlineshapes.addpicture
"PathToPictureYouWantToAdd",false,true,rngWrd

'Function AddPicture(FileName As String, [LinkToFile],
[SaveWithDocument], [Range])
'I copied the above from the help file to tell you what the arguments
are.

docWrd.protect 2,false,""

docWrd.save

docWrd.close

appWrd.quit

set rngWrd = nothing

set docWrd = nothing

set appWrd = nothing
Dave Griffiths
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Running Wod from Access


Thanks very much. I haven't had a chance to try it yet but I can see
what you're doing am I'm sure it will be OK

Dave

usddcm@yahoo.com (Dan Morgan) wrote in message news:<fe4ad91b.0410300206.1f54267c@posting.google. com>...[color=blue]
> dave@k2computers.co.uk (Dave Griffiths) wrote in message news:<56242347.0410280346.4a246b11@posting.google. com>...[color=green]
> > I currently use Automation to send text to Word Templates from an
> > Access 97 application - using bookmarks to place the text where I want
> > it.
> >
> > My question is - is it also possible to send an image, and if so, how?
> >
> > TIA
> > Dave[/color]
>
> Something I use in vbscript (easily adaptable to vba) to add a
> signature to letter on install to the workstation. Should at least
> set you in the right direction.
>
>
> dim appWrd
> dim docWrd
> dim rngWrd
>
> set AppWrd = wscript.createobject("word.application")
>
> set docWrd = appWrd.documents.open("PathToTemplate")
>
> docWrd.unprotect
>
> set rngWrd = docWrd.bookmarks("signature").range
>
> docWrd.inlineshapes.addpicture
> "PathToPictureYouWantToAdd",false,true,rngWrd
>
> 'Function AddPicture(FileName As String, [LinkToFile],
> [SaveWithDocument], [Range])
> 'I copied the above from the help file to tell you what the arguments
> are.
>
> docWrd.protect 2,false,""
>
> docWrd.save
>
> docWrd.close
>
> appWrd.quit
>
> set rngWrd = nothing
>
> set docWrd = nothing
>
> set appWrd = nothing[/color]
Closed Thread