• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Missing property in PowerPoint dictionary!?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Missing property in PowerPoint dictionary!?


  • Subject: Re: Missing property in PowerPoint dictionary!?
  • From: Paul Berkowitz <email@hidden>
  • Date: Tue, 09 Aug 2005 08:57:41 -0700
  • Thread-topic: Missing property in PowerPoint dictionary!?

On 8/9/05 7:03 AM, "email@hidden" <email@hidden> wrote:

>
>> 'do Visual Basic' still works:
>>
>> tell application "Microsoft PowerPoint"
>>     do Visual Basic "ActivePresentation.Slides(1).Shapes(2).TextFrame_
>>     .TextRange.ParagraphFormat.SpaceBefore = 6"
>> end tell
>
> This works for setting the property, but how about getting it?
> What I do now is this (please, no laughing...):
> 1. Use AS to create shape named "temp"
> 2. Use VB to get the space before value from the text I want
> 3. Use VB to set the content of the "temp" shape to the space before value
> 4. Use AS to get the content of the "temp" shape
> 5. Use AS to delete the "temp" shape
>
> Any better ideas?

Ah, yes, back to the old tricks needed before Office 2004. To get a value
returned from 'do Visual Basic', what I would do would be to coerce it to
string (if it isn't string already) and write it to a text file from 'do
Visual Basic', then read it back in AS. VB's Open for Output and Print # are
exactly like AS's open for access with write permission and write, except
you have to get the File Number (like the result of open for access) first
via FreeFile method. (In VB a single quote ' is used for comments.)

Like this:

    set tempFilePath to ((path to temporary items as string) & "Shared Text
File")
    set vbTextFilePath to "\"" & tempFilePath & "\""
    tell application "Microsoft PowerPoint"
        do Visual Basic "
        Dim spb As Integer, FileNumber As Integer

        spb = ActivePresentation.Slides(1).Shapes(2).TextFrame_
            .TextRange.ParagraphFormat.SpaceBefore

       'write spb as string to text file, replacing any text there
        FileNumber = FreeFile
        Open " & vbTextFilePath & " For Output As #FileNumber
        Print #FileNumber, CStr(spb) ' coerce spb to string  and write
        Close #FileNumber
        "
    end tell

    set spb to (read alias tempFilePath) as integer

and continue on from there.

--
Paul Berkowitz


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • HELP Quark 6.5 Crashing on Print!!!
      • From: Jason Bourque <email@hidden>
References: 
 >Re: Re: Missing property in PowerPoint dictionary!? (From: <email@hidden>)

  • Prev by Date: Re: Re: Missing property in PowerPoint dictionary!?
  • Next by Date: AppleScript and FileMaker 7 Examples
  • Previous by thread: Re: Re: Missing property in PowerPoint dictionary!?
  • Next by thread: HELP Quark 6.5 Crashing on Print!!!
  • Index(es):
    • Date
    • Thread