locked
vba in Sharepoint Designer 2007 RRS feed

  • Question

  • In Sharepoint Designer I want to use VBA to set up functions and procedures and call them using VBscript and the script tag in HTML similar to the way a "src" attribute can be set in the script tag for Javascript.  Can this be accomplished in Sharepoint Designer VBA?   


    • Moved by Mike Walsh FIN Monday, September 12, 2011 6:16 PM sod q (From:SharePoint - Development and Programming (pre-SharePoint 2010))
    • Edited by Mike Walsh FIN Monday, September 12, 2011 6:17 PM Sorry. Typo. The move reason should have been SPD q
    Monday, September 12, 2011 5:00 PM

Answers

  • Hi DW_USEMCO,

    Do you mean to open a new window in browser using VBScript?

    If so, you could use window.open() function or please take a look at following demo (in an aspx page).

    <%@ Page Language="C#" %>
    <html dir="ltr">
    <head runat="server">
    <META name="WebPartPageExpansion" content="full">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>test page</title>


    <script type="text/vbscript">
    Sub btLink_onclick
    //change scr to
    http://www.microsoft.com
    btLink.src=”http://www.microsoft.com”
    testlink=btLink.src
    window.open(testlink)
    End Sub
    </script>

    </head>
    <body>

    <form id="form1" runat="server">
    </form>
    <input type="button" name="btLink" src="http://www.bing.com" value="click to open link in new window"/>
    </body>
    </html>

    Best regards,
    Emir Liu
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    tnmff@microsoft.com.

    • Marked as answer by Emir Liu Friday, September 23, 2011 2:39 AM
    Tuesday, September 13, 2011 3:18 AM