PC Review


Reply
Thread Tools Rate Thread

Re: Powerpoint won't show some picures

 
 
Glen Millar
Guest
Posts: n/a
 
      8th Jun 2008
Hi Tom,

The little red x means PowerPoint cant load/ find the image. It's possible
there is a change in how the new version of PowerPoint handles the code.
Could you post a sample of the code?

--

Regards,
Glen Millar
Microsoft PPT MVP

Please tell us your PowerPoint version

Tutorials and PowerPoint animations at
the original www.pptworkbench.com
glen at pptworkbench dot com
------------------------------------------

<(E-Mail Removed)> wrote in message
news:qHG2k.105$(E-Mail Removed)...
>I have moved from WindowsXP to Vista64 and Office 2003 to Office 2007.
>
> I have a number of power point files that have pictures of various
> railroad
> topics. There were created with macros I wrote to link files into the
> power
> point file. A small number of the files will not display on the new
> computer. The files will display if double clicked in explorer. I have
> tried
> running the macro again to link the files and get the same result a small
> red X in the upper left corner.
>
> What can I do to fix these images?
>
> Thanks
> Tom


 
Reply With Quote
 
 
 
 
Glen Millar
Guest
Posts: n/a
 
      9th Jun 2008
Hi,

I suspect your code is out of date. I ran it line by lien until I got a
compile error. Hopefully someone more aux faux with 2007 will be along
shortly.

--

Regards,
Glen Millar
Microsoft PPT MVP

Please tell us your PowerPoint version

Tutorials and PowerPoint animations at
the original www.pptworkbench.com
glen at pptworkbench dot com
------------------------------------------

<(E-Mail Removed)> wrote in message
news:nh%2k.178$(E-Mail Removed)...
> Here is the code that links the files.
> This was written for the first version of PowerPoint that supported
> macros,
> I think Office 2000. I don't recall making any changes for Office 2003.
>
> The intent is to link all the image files in the same folder as powerpoint
> was launced from. I leave the images and powerpoint in that folder.
>
> Since you are looking at the code the text box done in linkphoto routine
> is
> not working either.
>
> Thanks for taking a look.
>
>
> Sub LinkFiles()
> Dim DoShutdown As Boolean
> DoShutdown = StartUp
> If (OkToRun = True) Then
> Dim CurrentPath, FileSystem, Folder, FileList, FileIndex
> Dim SlideCount As Long
> Dim Count As Long
> Dim StartDate As Date
> Dim EndDate As Date
> Dim StartTime As Date
> Dim EndTime As Date
> Dim UpperCaseName As String
> Dim Msg As String
> Dim LinkErrorCount As Long
>
> ' need a place to copy problem photos
> If Dir(ActivePresentation.Path & "\ERRORS\", vbDirectory) = "" Then
> MkDir (ActivePresentation.Path & "\ERRORS\")
> End If
>
> LinkErrorCount = 0
> Application.WindowState = ppWindowMinimized
> StartDate = Date
> StartTime = Time
> Write #Logfile, "Starting " & StartDate & " " & StartTime
> Count = 0
>
> Set FileSystem = CreateObject("Scripting.FileSystemObject")
> Set Folder = FileSystem.GetFolder(ActivePresentation.Path())
> Set FileList = Folder.Files
> For Each FileIndex In FileList
> UpperCaseName = UCase$(FileIndex.Name)
> If IsPicture(UpperCaseName) = True Then
> SlideCount = ActivePresentation.Slides.Count() + 1
> Write #Logfile, " Slide # " & SlideCount _
> & " Input # " & Count & " " & UpperCaseName
> On Error GoTo AddSlideError
> ActiveWindow.View.GotoSlide
> Index:=ActivePresentation.Slides _
> .Add(Index:=SlideCount,
> Layout:=ppLayoutBlank).SlideIndex
> On Error GoTo 0
>
> Count = Count + 1
> If LinkPhoto(UpperCaseName) = False Then
> LinkErrorCount = LinkErrorCount + 1
> MarkInError (UpperCaseName)
> End If
> If (Count Mod 500 = 0) Then ' save every 500 photos
> ActivePresentation.Save
> EndDate = Date
> EndTime = Time
> Write #Logfile, " Photos per second " & ((EndTime -
> StartTime) / Count)
> End If
> End If
> NextSlide:
> Next
> SlideCount = ActivePresentation.Slides.Count() + 1
> ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides _
> .Add(Index:=SlideCount, Layout:=ppLayoutBlank).SlideIndex
> EndDate = Date
> EndTime = Time
> ActivePresentation.Save
> Write #Logfile, "Finished, Presentation Saved " & EndDate & " " &
> EndTime
> Write #Logfile, " Photos per second " & (EndTime - StartTime) /
> Count
> Write #Logfile, " Errors " & LinkErrorCount
> Application.WindowState = ppWindowNormal
> Msg = "Processed " & Count & " Links."
> MsgBox Msg
> End If
> If DoShutdown = True Then ShutDown
> Exit Sub
>
>
> Private Function LinkPhoto(PhotoName) As Boolean
> On Error GoTo AddPhotoError
> ActiveWindow.Selection.SlideRange.Shapes _
> .AddPicture(FileName:=PhotoName, _
> LinkToFile:=msoTrue, _
> SaveWithDocument:=msoFalse, _
> Left:=0, _
> Top:=0, _
> Width:=GetWidth, _
> Height:=GetHeight).Select
> On Error GoTo 0
> With ActiveWindow.Selection.ShapeRange
> .Name = GetPhotoObjectName
> .PictureFormat.Contrast = 0.5
> .PictureFormat.Brightness = 0.5
> .PictureFormat.ColorType = msoPictureAutomatic
> .PictureFormat.TransparentBackground = msoFalse
> .Fill.Visible = msoFalse
> .Line.Visible = msoFalse
> .PictureFormat.CropLeft = 0#
> .PictureFormat.CropRight = 0#
> .PictureFormat.CropTop = 0#
> .PictureFormat.CropBottom = 0#
> .ScaleHeight 1#, msoTrue, msoScaleFromTopLeft
> .ScaleWidth 1#, msoTrue, msoScaleFromTopLeft
> .LockAspectRatio = msoTrue
>
> If (.Height < (0.5 * GetHeight)) Then
> .Height = (0.8 * GetHeight)
> End If
> If (.Width < (0.5 * GetWidth)) Then
> .Width = (0.8 * GetWidth)
> End If
> If (.Height > GetHeight) Then
> .Height = GetHeight
> End If
> If (.Width > GetWidth) Then
> .Width = GetWidth
> End If
> .Left = (GetWidth - .Width) / 2
> .Top = (GetHeight - .Height) / 2
> End With
> On Error GoTo AddVisibleTextError
> ActiveWindow.Selection.SlideRange.Shapes.AddLabel _
> (msoTextOrientationHorizontal, _
> 20, _
> GetHeight + 2, _
> GetWidth - 40, _
> 20).Select
> On Error GoTo 0
> ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters _
> (Start:=1, Length:=0).Select
> ActiveWindow.Selection.ShapeRange.Name = GetVisibleTextObjectName
> With ActiveWindow.Selection.TextRange
> .Text = PhotoName
> With .Font
> .Name = "Times New Roman"
> .Size = 24
> .Bold = msoTrue
> .Italic = msoFalse
> .Underline = msoFalse
> .Shadow = msoFalse
> .Emboss = msoFalse
> .BaselineOffset = 0
> .AutoRotateNumbers = msoFalse
> .Color.SchemeColor = ppFill
> End With
> End With
> ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
> ActiveWindow.Selection.Unselect
> LinkPhoto = True
> LinkPhotoEnd:
> Exit Function


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
My "My Picures" folder attribute is stuck on "Read Only" JV Windows XP Basics 1 28th Aug 2004 06:10 AM
My Picures folder icon =?Utf-8?B?TWljaGVsbGU=?= Windows XP Basics 3 27th Aug 2004 04:10 AM
Attaching picures to show in Outlook =?Utf-8?B?TFA=?= Microsoft Outlook 1 3rd Apr 2004 05:41 PM
wont let me copy to my cd rom.picures,files,etc. =?Utf-8?B?bWFyaW5lNzY=?= Windows XP New Users 1 8th Mar 2004 08:55 PM
bitmap vs jpeg picures cbaldy Windows XP Internet Explorer 1 29th Nov 2003 11:52 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:19 PM.