VBA创建错误:Sub未定义

时间:2015-07-25 14:59:04

标签: vba coreldraw

我尝试使用Microsoft VB for applications(VBA)为CorelDraw创建一个宏。我在“form1”窗口中设置了表单和一段代码。这意味着在单击生成按钮时创建一个圆圈,但它表示

  

“sub或function not defined”

以下代码

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>MY SITE</title>
    </head>
    <body>
        <form name="MyForm1" action="reaction2.jsp" method="POST">
        <table border="0">
            <tr>
                <td> Issue ID : </td>
                <td><input name="myText" value="" type="text" width="100"/></td>
            </tr>
            <tr>
                <td> Book Name : </td>
                <td><input name="myText1" value="" type="text" width="100"/></td>
            </tr>
            <tr>
                <td> Book ID : </td>
                <td><input name="myText2" value="" type="text" width="100"/></td>
            </tr>
            <tr>
                <td> Issue Date : </td>
                <td><input name="myText3" value="" type="date" width="100" id="txt1" onchange="setValue()"/></td>
            </tr>
            <tr>

                <td> Expiry Date : </td>
                <td><input name="myText4" value="" type="text" width="100" id="txt2" /></td>

            </tr>
            <tr>
                <td> Staff ID : </td>
                <td><input name="myText5" value="" type="text" width="100"/></td>
            </tr>

        </table>
            <p> <input type="submit" name="button3" value="Issue Book" /></p>
        </form>
        <script>
            function setValue()
                { 
                    var tt= document.getElementById('txt1').value;
                    var date=new date(tt);
                    var newdate=new date(date);
                    newdate.setDate(newdate.getDate() + 14 );
                    var dd = newdate.getDate();
                    var mm = newdate.getMonth() + 1;
                    var y = newdate.getFullYear();

                    var someFormattedDate = dd + '/' + mm + '/' + y;
                    document.getElementById('txt2').value = someFormattedDate;
                }
        </script>
    </body>
</html>

PRIVATE SUB GENERATE_CLICK().

0 个答案:

没有答案