Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Powerpoint for Mac > VBA to Applescr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 9 Topic 2748 of 2869
Post > Topic >>

VBA to Applescript in PPT

by peterthebag@[EMAIL PROTECTED] May 9, 2008 at 09:03 AM

Hi,
i'm trying to use some of the example code in the MS guide VBA to
applescript and I seem to be getting a lot of errors.

I am trying to get a script that allows me to format text. Based on
the guide I have been trying the code below, but keep getting errors.
Could anyone guide me as to what is wrong?

Also, the code contains VBA - which seems to defeat the point - is
there a way to do it solely in AS?

many thanks,

Peter



tell application "Microsoft PowerPoint"
 --get the selected shape via the handler
set selectedShape to my GetSelectedShape() -- paste it in!
 tell text range of text frame of selectedShape
  tell its font
  set {font name, font size, font color, bold} to =AC
   {"Arial", 24, {255, 0, 0}, true}
  end tell
 end tell
end tell

to GetSelectedShape()
 set textFilePath to (path to tem****ary items as string) & "Shared
Text File"
 tell application "Microsoft PowerPoint"
activate
  set theIndex to slide index of slide of view =AC
  of active window
  set selectedSlide to slide theIndex of active presentation
  do Visual Basic "n =3D
ActiveWindow.Selection.ShapeRange.ZOrderPosition
 'write n as string to text file, replacing any text there
 FileNumber =3D FreeFile
 Open \"" & textFilePath & "\" For Output As #FileNumber
 Print #FileNumber, CStr(n)
 Close #FileNumber
 "
  set n to (read alias textFilePath before return) as integer
  set selectedShape to shape n of selectedSlide
  return selectedShape
 end tell
end GetSelectedShape
 




 9 Posts in Topic:
VBA to Applescript in PPT
peterthebag@[EMAIL PROTEC  2008-05-09 09:03:49 
Re: VBA to Applescript in PPT
Steve Rindsberg <abuse  2008-05-09 16:31:35 
Re: VBA to Applescript in PPT
peterthebag@[EMAIL PROTEC  2008-05-09 14:47:06 
Re: VBA to Applescript in PPT
Steve Rindsberg <abuse  2008-05-10 00:40:04 
Re: VBA to Applescript in PPT
peterthebag@[EMAIL PROTEC  2008-05-10 00:49:59 
Re: VBA to Applescript in PPT
Steve Rindsberg <abuse  2008-05-12 16:24:58 
Re: VBA to Applescript in PPT
peterthebag@[EMAIL PROTEC  2008-05-10 01:05:06 
Re: VBA to Applescript in PPT
peterthebag@[EMAIL PROTEC  2008-05-13 01:11:02 
Re: VBA to Applescript in PPT
Steve Rindsberg <abuse  2008-05-13 17:01:57 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 9:12:21 CDT 2008.