DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to customize the Diadem Report Export to PowerPoint Menu function?

Solved!
Go to solution

H All, 

Can I define a different "Power Point Export" script to run when selecting the "PowerPoint Export" File pull down menu when in "Diadem Report"? 

 

I know this menu uses the "C:\Program Files (x86)\National Instruments\DIAdem 2012\Resource\PowerPointTemplate.ppt" template file.    My problem is I am unable to "customize" the PPT template enough to get certain items to position correctly on the slides.  

 

What I did was to modify the script "C:\Program Files (x86)\National Instruments\DIAdem 2012\Examples\Documents\REPORT_Layout_to_PowerPoint.VBS" with the changes that I need, define the ppt template to use.  Run the script and eveything works as it should.   (This script is not tied to the pull down menu function  - maybe I have something defined wrong somewhere.)

 

I want to get away from having to open this script every time I want to create a ppt.  I would much rather select it from the pull down menu.  Do the pull down "PowerPoint Export" utilize a defined script?

 

Thank You

John

 

 

 

0 Kudos
Message 1 of 5
(4,184 Views)

Hi John,

 

If you have DIAdem 2015, you can customize the menus with the BarManager object.  That particular menu item is encrypted and read-only, so you have to clone as much from it as you can, then assign your own code to the click action property of your new menu item, then remove the default menu item and insert your new one, like this:

 

Call BarManager.Reset
Set Bar = BarManager.Bars("REPMenuFile")
Set Action1 = Bar.UsedActionObjs("REPDlgPPTExport")
Set Action2 = BarManager.ActionObjs.Add("REPDlgPPTExport2", "CustomButton")
Action2.Caption = Action1.Caption
Action2.Tooltip = Action1.Tooltip
Action2.Picture = Action1.Picture
Action2.OnClickCode.Code = "MsgBox ""Your Code Here"""
Count = Bar.UsedActionObjs.Count
Call Bar.UsedActionObjs.Remove("REPDlgPPTExport")
Call Bar.UsedActionObjs.Add(Action2)
Call Bar.UsedActionObjs.Move(Count, 14)

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 5
(4,166 Views)

Hi Brad,

This looks exactly what I am trying to do, but i am having a problem with the menu ids.

 

"REPMenuFile"  does seem to be recognized as the ID.

 

I have tried to use the "contrl -shift" feature to display the ID, but it doesn't work on the file menu bar.-

 

I am able to change the menu to "REPMain" and add it.  This will work fine for me, but I would like to understand why the file pull down menu didn't work.

 

Did the ID name change at some point, did it become encrypted as well?

 

Thank

John

0 Kudos
Message 3 of 5
(4,112 Views)
Solution
Accepted by topic author jbelow2

Hi John,

 

If you use DIAdem before 2015 you need the old syntax to modify the menu. Here is an example:

 

Dim strPanel, strMyMenu, intCount
strPanel = "REPORT"
strMyMenu = "List of menus in DIAdem "& strPanel & ":"
Call WndOpen(strPanel)
Call MenuItemCountGet(strPanel, "M.1")
For intCount = 1 to MenuItemCount
   Call MenuItemInfoGet(strPanel, "M.1." & intCount)
   strMyMenu = strMyMenu & VBCrLf & MenuItemTitle & " - " & intCount
Next
Call MsgBoxDisp(strMyMenu)

strMyMenu = ""
Call MenuItemInfoGet(strPanel, "M.1.14")
strMyMenu = "Pos. 14 : " & MenuItemTitle
Call MsgBoxDisp(strMyMenu)

Call MenuItemChange("REPORT","M.1.14","My PPT","Call Msgbox(""Hallo"")")

Greetings

Walter

 

 

0 Kudos
Message 4 of 5
(4,053 Views)

Thanks Walter!!

 

This is exactly what I was trying to do, and it works great.     I am going to clean it up and roll it out.

 

My problem was that I have Diadem 2012. and not 2015..

 

Thank You.

 

 

 

 

0 Kudos
Message 5 of 5
(4,045 Views)