Managing Asthma and Other Illnesses Through Breathing Exercises
Janine White's Personal Blog
Posted by
Janine White
at
9:08 PM
0
comments
Links to this post


Posted by
Janine White
at
11:24 AM
0
comments
Links to this post
Labels: April Fool's Day, blogs, Gmail, Google, Janine White, JanineWhite
Dim pic As IPictureDispIn order to get an image from the web into a PowerPoint 2007 presentation, one must first save the image locally as a file, then reference the file. The Module code is adapted from Workaround for Powerpoint 2007 VBA AddPicture web image problem. The URLs referenced below are sample images that I created for a good image and an image not available error. Replace them with your own images.
'Load good image
Set pic = stdole.StdFunctions.LoadPicture("http://tinyurl.com/d85tgr")
Image1.Picture = pic
Option ExplicitIn the presentation code, for example, use the following code to load the good image from the default file to an Image control:
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
(ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long
Private Const ERROR_SUCCESS As Long = 0
Private Const BINDF_GETNEWESTVERSION As Long = &H10
Private Const INTERNET_FLAG_RELOAD As Long = &H80000000
Public Function DownloadFile(sSourceURL As String, _
sLocalFile As String) As Boolean
DownloadFile = URLDownloadToFile(0&, _
sSourceURL, _
sLocalFile, _
BINDF_GETNEWESTVERSION, _
0&) = ERROR_SUCCESS
End Function
Sub ImportPictureFromWeb(Optional SourceFile As String _
, Optional DestinationFile As String)
Dim sSourceURL As String
Dim sLocalFile As String
Dim x As Variant
If Len(SourceFile) > 0 Then
sSourceURL = SourceFile
Else
'Load image not available error image
sSourceURL = "http://tinyurl.com/d8home"
End If
If Len(DestinationFile) > 0 Then
sLocalFile = DestinationFile
Else
'Default file
sLocalFile = "C:\PowerPointImage.gif"
End If
x = DownloadFile(sSourceURL, sLocalFile)
End Sub
Dim pic As IPictureDisp
Module1.ImportPictureFromWeb ("http://tinyurl.com/d85tgr")
Set pic = stdole.StdFunctions.LoadPicture("C:\PowerPointImage.gif")
Image1.Picture = pic
Posted by
Janine White
at
11:07 AM
0
comments
Links to this post
Labels: 2007, image, Janine White, JanineWhite, load, Microsoft, Office, PowerPoint, programming, URL, VBA
Posted by
Janine White
at
3:05 PM
1 comments
Links to this post
Labels: Access, blogs, functions, Janine White, JanineWhite, Microsoft, random, records, tables
Posted by
Janine White
at
10:00 AM
0
comments
Links to this post
Labels: abortion, blogs, counseling, health, Janine White, JanineWhite, medicine, practice
Posted by
Janine White
at
5:03 PM
0
comments
Links to this post
Labels: 2009, blogs, Happy New Year, Janine White, JanineWhite
Posted by
Janine White
at
1:49 PM
10
comments
Links to this post
Labels: bankruptcy, business, customer service, Ironman, Keys Fitness, treadmill, warranty
(including Janine's Blog, Flickr photos and bookmarks)

Feel free to leave comments on the entries, or, if you would like to leave a
general comment on the blog, please sign the Guestbook.
