Create Powerpoint Textbox with DXL

Dear Community,

 

I'm currently working on a DXL Reporting Script to Powerpoint 2010. Basic concept is to create a Powerpoint, fill out some Tables and some Textboxes with data from Doors.

I got almost everything working, except creating new Textboxes. I tested some code in VBA (which works) but I somehow am not able to translate it to DXL. Could please someone point out how to create a Textbox in Powerpoint using DXL?

 

VBA example Code

PPTFile.Slides(1).Shapes.AddTextbox(msoTextOrientationHorizontal, 100, 100, 200, 50).Name = s

 

DXL Code (not working)

clear(args)
put(args, "msoTextOrientationHorizontal")
put(args, posLeft)
put(args, posTop)
put(args, dx)
put(args, dy)
oleMethod(objShapes, "AddTextbox", args, objTextBox)
olePut(objTextBox, "Name", TextboxTitle)

 

I always get the Error Message: -R-E- DXL: <Line:383> null OleAutoObj parameter was passed into argument position 1

which of my understanding means that I don't reference the handle "objTextBox" properly.

Any suggestions would be appreciated.

 

Cheers, Tillmann

 


t.schatz - Thu Feb 19 10:51:39 EST 2015

Re: Create Powerpoint Textbox with DXL
Wolfgang Uhr - Fri Feb 20 15:45:47 EST 2015

Hi

  1. Nobody knows, which line in your code snippet has the line number 383 in your productive code. I assume that line 8 is refered. That means that line 7 does not return a valid OleAutoObj. This means that line 7 produces an error messages which you do not cath. And this means that you ignore any errors in your code, which is the best way to terrorize the future script users.
  2. The value msoTextOrientatonHorizontal is a constant which is valid an a vba developement system but not in a dxl script. Refering to this link http://stackoverflow.com/questions/12231435/what-is-constant-value-of-msotextorientationhorizontal-in-vba you should use the value "1". You also can find this value with the line "debug.print msoTextOrientationHorizontal" in your vba system.

Best regards

Wolfgang

Re: Create Powerpoint Textbox with DXL
t.schatz - Wed Feb 25 03:35:05 EST 2015

Wolfgang Uhr - Fri Feb 20 15:45:47 EST 2015

Hi

  1. Nobody knows, which line in your code snippet has the line number 383 in your productive code. I assume that line 8 is refered. That means that line 7 does not return a valid OleAutoObj. This means that line 7 produces an error messages which you do not cath. And this means that you ignore any errors in your code, which is the best way to terrorize the future script users.
  2. The value msoTextOrientatonHorizontal is a constant which is valid an a vba developement system but not in a dxl script. Refering to this link http://stackoverflow.com/questions/12231435/what-is-constant-value-of-msotextorientationhorizontal-in-vba you should use the value "1". You also can find this value with the line "debug.print msoTextOrientationHorizontal" in your vba system.

Best regards

Wolfgang

Hey Wolfgang,

thank you very much for your response! I changed the code so I get the OLE Error messages, this was quite helpful, this way I discovered a few more faults. Thanks for the Tip withe the "debug.print msoTextOrientationHorizontal", didn't know about that before.

Cheers, Tillmann