Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vba access to add notes to ppt 2

Status
Not open for further replies.

aldi07

MIS
Jun 22, 2010
100
CA
Hi,
I am using the following vba access to transfer pictures from access to powerpoint:

While Not rs.EOF
MySource = rs![Photo_Path_And_Name].Value
MyDestination = "D:\Photos\DataMiningResult\Slide" & Trim(Str(I)) & ".jpg"
FileCopy MySource, MyDestination
OldFileName = MyDestination
NewFileName = "D:\Photos\DataMiningResult\Slide" & rs![Photo_Date] & "_" & Trim(Str(I)) & ".jpg"
Name MyDestination As NewFileName
I = I + 1
rs.MoveNext
Wend

It works well. But I would like to complete the powerpoint, by adding some informations from access into the powerpoint notes for each slide. Is there a way to do it?

Thank you in advance.
 
I was looking forward to use your method, since it looks much more elegant. Unfortunately, I get the following error message:
Method 'SaveAs' of object '_Presentation' failed.
In my code, I do not use the & ".ppt", because I discovered it is implied as a PowePoint document.
So I tried your code once with, and once without the & ".ppt". Same error.
 
There are reserved characters ('/', ':') in file name.

The following reserved characters:
[ul]
[li] < (less than)[/li]
[li] > (greater than)[/li]
[li] : (colon)[/li]
[li] " (double quote)[/li]
[li] / (forward slash)[/li]
[li] \ (backslash)[/li]
[li] | (vertical bar or pipe)[/li]
[li] ? (question mark)[/li]
[li] * (asterisk)[/li]
[/ul]

combo
 
What Combo is saying, try:[tt]
MyFileName = "D:\Photos\DataMiningResult\AllMyPhotos" & Format(Now, "mm[highlight #FCE94F]_[/highlight]dd[highlight #FCE94F]_[/highlight]yyyy hh[highlight #FCE94F]_[/highlight]nn[highlight #FCE94F]_[/highlight]ss AM/PM")
.SaveAs MyFileName, ppSaveAsPresentation [/tt]

BTW - Is [tt]AllMyPhotos[/tt] the beginning of the names of all of your files? Or a folder where you keep them?

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Forgot to answer your question:
AllMyPhotos is the beginning of the name of the PowerPoint file that resides in D:\Photos\DataMiningResult\. That folder is cleared from its content then filled with the user's selction by the following queries:

Code:
        DoCmd.SetWarnings False
            DoCmd.OpenQuery "qryDataMiningResult_Del"
            DoCmd.OpenQuery "qryDataMining_App"
        DoCmd.SetWarnings True
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top