Link to home
Start Free TrialLog in
Avatar of Stanciu
Stanciu

asked on

ASP and PowerPoint

How can I use PowerPoint objects in ASP?
I need to save a ppt file as JPEG components from inside ASP code.

Thanx,
Horatiu Stanciu
Avatar of weesiong
weesiong

Stanciu,

Try this:

<%

theformat = 4 'i am no sure is what variable, you can try from 1 - 16

Set wrd = CreateObject("Word.Application")
wrd.Documents.Open Server.MapPath("aa.ppt")
wrd.Visible = False

wrd.Application.ActivePresentation.SaveAs Server.MapPath("aa.jpg"), theformat
wrd.Application.quit
Set wrd = Nothing

%>

Regards,
Wee Siong
ASKER CERTIFIED SOLUTION
Avatar of weesiong
weesiong

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Stanciu

ASKER

I don't know ASP, I know a little VB, I roughly put your code in an ASP page (IIS installed), but nothing happened. Can you give me some details?

Thanx,
H
Stanciu,

<%
On Error Resume Next

ppSaveAsHTML = 17
Set Wrd = CreateObject("PowerPoint.Application")
wrd.Visible = True
Wrd.Presentations.Open (Server.MapPath("power.ppt"))
wrd.ActivePresentation.SaveAs Server.MapPath("aa.jpg"), ppSaveAsHTML
wrd.quit
Set wrd = Nothing

IF Err.Number > 0 Then
    Err.Raise 6  ' Raise an overflow error.
    Response.Write "Error # " & CStr(Err.Number) & " " & Err.Description & VBCRLF & "<br>"
    Err.Clear    ' Clear the error.
Else
    Response.Write "Convert To JPEG Successfully"
End IF
%>

Regards,
Wee Siong
Stanciu,

After succefully, you can goto the Folder for the asp, you can see have a new folder call aa, and you can see have a jpg file insert in the folder :)

Good Luck!

Regards,
Wee Siong
Admin notified of user neglect. Force/accepted by

Netminder
Community Support Moderator
Experts Exchange