Jump to content

Recommended Posts

Posted

Hello, I'm trying to add an image to a publisher page but I  am not having much luck. Any help would be appreciated.

 

Local $PublisherApp = ObjCreate("Publisher.Application")

Local $Document = $PublisherApp.Open(@scriptdir & "\" & "example.pub")

$PublisherApp.ActiveWindow.Visible = True

Local $Page = $Document.Pages(1)

Local $Shape = $Page.Shapes.AddShape(1, 144, 144, 72, 144)

$Shape.Shapes.AddPicture("C:\path\pic.jpg", 0, 0, -1, -1)

I'm new to editing office applications through autoit, so I'm having some difficulty.

Posted

Oh, it wouldn't let me edit, but the error I get is: 'The requested action with this object has failed' and points to the 'AddPicture' command.

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
×
×
  • Create New...