Jump to content

Recommended Posts

Posted

Application.ActivePresentation.Slides(1).Shapes(2) _

    .TextFrame.TextRange.ParagraphFormat.Alignment = ppAlignLeft

Help convert text VBA to autoit!

Thank All!

Posted

Can you please show us the rest of your AutoIt script? At least the part where you start PowerPoint and open the presentation.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted (edited)

#included <Powerpoint.au3> ('?do=embed' frameborder='0' data-embedContent>>)

VBA => https://msdn.microsoft.com/en-us/library/office/ff744029(v=office.14).aspx

Func _save($loi)
    Local $j = 1, $k = 1, $h = 1, $ghep_dong, $tach_dong, $PresInterface, $objPres
    If $loi == '' Then Return 0
    $objPPT = _PPT_PowerPointApp()
    If @error Then
        MsgBox(0, "", "No PowerPoint available")
        Return 0
    EndIf
    $ghep_dong = ''
    $tach_dong = StringSplit($loi & @CRLF, @CRLF)
    $PresInterface = _PPT_CreatePresentation($objPPT) ;Get presentation interface
    $objPres = _PPT_PresentationAdd($PresInterface) ;Add a new presentation
    _PPT_PageSetup($objPres)
    While $h
        For $i = 1 To 6
            If $j >= $tach_dong[0] Then
                $h = 0
                ExitLoop
            EndIf
            $ghep_dong &= $tach_dong[$j] & @CR
            $j += 1
        Next
        $objSlide = _PPT_SlideCreate($objPres, $k, $PPLAYOUTBLANK)
        _PPT_SlideAddTextBox($objSlide, 0, 0, 720, 720) ;add a plain textbox
        _PPT_SlideTextFrameSetText($objSlide, 1, $ghep_dong)
        _PPT_SlideTextFrameSetFontSize($objSlide, 1, 48)
        _PPT_SlideTextFrameSetFont_Bold($objSlide, 1, True)
        $ghep_dong = ''
        $k += 1
    WEnd

    _PPT_PresentationSaveAs($objPres, @ScriptDir & "\Lyrics\" & $title & ".ppt")
    ;_PPT_PresentationClose($objPres) ; Close presentation
    ;_PPT_PowerPointQuit($objPPT) ;Exit PowerPoint
EndFunc   ;==>_save
Edited by BamBuVn
Posted

So your statement should be:

Global Const $ppAlignLeft = 1 ; Left aligned
$objPPT.ActivePresentation.Slides(1).Shapes(2).TextFrame.TextRange.ParagraphFormat.Alignment = $ppAlignLeft

My UDFs and Tutorials:

  Reveal hidden contents

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...