none
populating vba labels on a powerpoint 2010 using public subroutines on a macro from vs2012 application RRS feed

  • Question

  • I have a PowerPoint 2010 document in which I have placed a macro that I want to use populate vba labels on the PowerPoint document with data from a SQL Server database.  I want to link to the PowerPoint 2010 document from a VS2010 VB.net project.  I want to populate the vba labels on the PowerPoint document and then print the document.  In other words I have a PowerPoint document that is a template that I want to print from a custom Service that is running on a Server 2012.  I have found all kinds of examples for older versions of VS where VB.net calls the public subroutines on the macro that have input parameters that can be used to populate the vba labels on the document.  However, I can't even find the "Imports" these example use when I try the examples on VS2012.  It looks like VS2012 is intended to work with Office in and entirely new way.  Can you point me in the direction I should go?  Examples are best for a programming light-weight like myself.
    Wednesday, March 13, 2013 11:03 PM

Answers

  • 1.  VBA is "Visual Basic for Applications" that is part of the developer capability of all office documents.  Inseted a VBA label object from the VBA developer toolbox.  At the top of the power point is a VBA label called "OrderedBy"  the text property of the label (OrderedBy.Text) is "Test".

    2.  "VBA Macro" is part of what was called Office "Remote Automation".  A VS program could make a remote automation call to execute the macro that would control the properties of the Office document.  In this case, I want to populate the VBA label object "OrderedBy.text" property with text that was generated by a VS2012 project.  I then want the vs2012 project to print the above PowerPoint sheet with all the label .text  information that the VS 2012 project had placed in the sheet.

    3.  I know about adding references, but if I am going to do the equivalent of "Remote Automation" what reference do I select?  There are many examples of what to do for older versions of Visual Studio, but I can't find anything for VS2012.  That is why I thought MS has come up with newer, slicker way of doing "Remote Automation".

    Thanks,

    Jay

    Monday, March 18, 2013 6:12 PM
  • Thursday, March 21, 2013 6:57 PM

All replies

  • Hi mavsrcheap,

    Thank you for posting in the MSDN Forum.

    1. Could you please show me what a VBA label is? You can take screenshots and upload it.
    2. Do you mean that you want to call VBA macro from your application created in VS2012?
    3. If you want to reference to an assembly, you can right click "References",  in the popped up menu click "Add References".

    Hope it helps.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 15, 2013 11:03 AM
    Moderator
  • IMHO vs2012 is focused on those that want to play in the cloud. My recommendation for office developers is don't move off of vs2010 unless you have a very specific reason to.

    just a note from the side,

    al


    If this answer solves your problem, please check Mark as Answered. If this answer helps, please click the Vote as Helpful button. Al Edlund Visio MVP

    Saturday, March 16, 2013 12:53 PM
  • 1.  VBA is "Visual Basic for Applications" that is part of the developer capability of all office documents.  Inseted a VBA label object from the VBA developer toolbox.  At the top of the power point is a VBA label called "OrderedBy"  the text property of the label (OrderedBy.Text) is "Test".

    2.  "VBA Macro" is part of what was called Office "Remote Automation".  A VS program could make a remote automation call to execute the macro that would control the properties of the Office document.  In this case, I want to populate the VBA label object "OrderedBy.text" property with text that was generated by a VS2012 project.  I then want the vs2012 project to print the above PowerPoint sheet with all the label .text  information that the VS 2012 project had placed in the sheet.

    3.  I know about adding references, but if I am going to do the equivalent of "Remote Automation" what reference do I select?  There are many examples of what to do for older versions of Visual Studio, but I can't find anything for VS2012.  That is why I thought MS has come up with newer, slicker way of doing "Remote Automation".

    Thanks,

    Jay

    Monday, March 18, 2013 6:12 PM
  • Hi Jay,

    Thank you for your last reply.

    Could you please tell me the name of the exact assemble you use when developing on the older versions of Visual Studio?

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, March 19, 2013 7:33 AM
    Moderator
  • Thursday, March 21, 2013 6:57 PM
  • Hi Jay,

    Glad to hear that you've solved your issue.

    Thank you very much for sharing it.

    Have a nice day.


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 22, 2013 4:31 AM
    Moderator