Jump to content

Search the Community

Showing results for tags 'ms word'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hello Forum! I have a Word VBA Macro that inserts an image. I rebuilt the same behavior in AutoIt. Everything works the same except of one tiny difference. In VBA the image does NOT move down when i manually press <ENTER> after the Macro was running. In Autoit the image DOES move down when i press <ENTER> after the Script was running. Adding the image is just the beginning of the script. More Text will be added after. When i press <END> and then <ENTER> the behavior is the same again as in VBA. I tryd already several things but i do not want to hack in a Send("{END}") VBA: ' LOGO ---------------------------------------------------------------------------------------------------------------------- Dim Img As String Dim inlineShape As inlineShape Dim shape As shape Img = "C:\Logo.png" Set inlineShape = Selection.InlineShapes.AddPicture(FileName:=Img, LinkToFile:=False, SaveWithDocument:=True) inlineShape.LockAspectRatio = msoTrue inlineShape.width = CentimetersToPoints(9.58) Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Set shape = inlineShape.ConvertToShape shape.WrapFormat.Type = wdWrapMergeFront ' Set wrapping type to "Top and Bottom" < This is not wrong! ' Texts ------------------------------------------------------------------------------------------------------------------------ Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.ParagraphFormat.SpaceAfter = 10 'Selection.TypeParagraph AutoIt: #include <Word.au3> #include "WordConstants.au3" Global $oRange Global Const $wdAlignParagraphCenter = 1 ; Align Center Global Const $wdAlignParagraphLeft = 0 ; Align Left Global Const $wdWrapMergeFront = 4 ; In front of Text Global $Bild = @ScriptDir & "\Logo.png" Global $oWordApp = _Word_Create(); Start Word Global $oDoc = _Word_DocAdd($oWordApp); Create Document Global $oInlineShape = $oDoc.InlineShapes.AddPicture($Bild, False, True) $oInlineShape.LockAspectRatio = True $oInlineShape.width = CentimetersToPoints(9.58) $oRange = $oInlineShape.Range $oRange.ParagraphFormat.Alignment = $wdAlignParagraphCenter ; Center Global $oShape = $oInlineShape.ConvertToShape ; Convert InlineShape to Shape $oShape.WrapFormat.Type = $wdWrapMergeFront ; Set wrapping type to "Top and Bottom" < "MergeFront" selects "Top and Bottom" in Word $oRange = _Word_DocRangeSet($oDoc, 0) $oRange.ParagraphFormat.Alignment = $wdAlignParagraphLeft ; Align Left $oRange.ParagraphFormat.SpaceAfter = 10 ;$oWordApp.Selection.TypeParagraph ;$oRange.InsertAfter("Inserted text after range.") ;$oRange.EndKey($wdLine,0) ;$oRange.Text = @CRLF ;$oRange.Collapse($wdCollapseEnd)
×
×
  • Create New...