Griffin
Tue Dec 20 13:41:04 CST 2005
Is it possible that the query to the database is extracting the image from a
fiels and making a temporary file while the page is being viewed (session is
active). If so, the desired file may have already been erased by the time yo
go to get it later.
--
Martyn Griffin
"dcarva" wrote:
> Yeah. Thanks for looking at this. Danny
>
> "Jezebel" wrote:
>
> > Not sure where the problem is, then. If you set up that macro with a valid
> > filename, it certainly works.
> >
> >
> > "dcarva" <dcarva@discussions.microsoft.com> wrote in message
> > news:FDE7C318-0640-4AD1-974F-9347513CA1F4@microsoft.com...
> > > Basically,
> > >
> > > I have a word doc that creates flyers for soccer teams. The coaches run a
> > > macro that lists players from a SQL Server database. They select the
> > > player,
> > > click a button on the form, and the flyer is generated with the selected
> > > team
> > > members. All of the data is read from a SQL Server. (they are accessing
> > > the
> > > data over the internet) Somewhere in the loop, I also load the player's
> > > picture. The graphics are stored on a web server. But you have to download
> > > the picture onto your hard drive to get to work. (I have to send the
> > > graphics
> > > to the coaches) I want to bypass this step and just be able to insert the
> > > url
> > > of the image. The server was indeed serving the graphic at the time. In
> > > fact,
> > > I can even manually insert the graphic into Word using a url. The urls I
> > > use
> > > are good. Error 5152 means invalid file name. So, basically, the macro
> > > cannot
> > > play back what it recorded in this case. I was looking for a workaround.
> > > Thanks for reading this post.
> > >
> > > Danny
> > >
> > > "Jezebel" wrote:
> > >
> > >> There's nothing wrong with the code as such. Error 5152 is not a built-in
> > >> error (ie it's not generated by Word itself) so one can't comment on what
> > >> it
> > >> means; presumably there is, in fact, some problem with the filename
> > >> you've
> > >> used, or the server was not serving at the time.
> > >>
> > >> But what do you have in mind for the macro? -- presumably you don't want
> > >> to
> > >> insert the same file every time. Are you writing a separate macro for
> > >> each
> > >> graphic?
> > >>
> > >>
> > >>
> > >>
> > >> "dcarva" <dcarva@discussions.microsoft.com> wrote in message
> > >> news:1873E78D-942D-430E-8BE7-BD85EF3B59EE@microsoft.com...
> > >> > Hello,
> > >> >
> > >> > I recorded a Word macro that inserts an image that exists on the
> > >> > internet.
> > >> > I
> > >> > started recording and went to Insert->Picture->From File. Then I
> > >> > inserted
> > >> > the
> > >> > URL in the path bar. The file inserted fine and the vba code was
> > >> > recorded.
> > >> > However, when I play back the macro, it says "Error 5152" - something
> > >> > about
> > >> > the file not being valid. Anyone know how I can do something like this?
> > >> > I
> > >> > have images on a webserver that I want to display on my page using a
> > >> > macro. I
> > >> > am using Word 2000. Here is the vba code it records:
> > >> >
> > >> > Selection.InlineShapes.AddPicture FileName:= _
> > >> > "
http://www.site.com/test.gif", _
> > >> > LinkToFile:=False, SaveWithDocument:=True
> > >> >
> > >> > Thanks
> > >> > Danny
> > >>
> > >>
> > >>
> >
> >
> >