Search This Blog

Tuesday, April 11, 2017

Power Point Add Current and Total Slide Number in Footer


How to show Current and Total Slide Number in Power Point Presentation



If you want to show current slide number and total slide number in Footer:
Like : Page (current slide) of (total slide in file) so...
Page 1 of 15
Page 2 of 15
Page 3 of 15

Please follow the following step : 

Step 1 : Create Your PPT File.
Step 2 : Click on Insert Menu then Click on Slid Number Icon.



Step 3 : Click on Slide Tab, check on "Slide number" and then click on Apply to All.



Step 4 : Click on View Menu and click on Macros


Step 5 : Enter Macro Name and Click on Create


Step 6 : Copy given code in your created method.

Sub SetFooterText()
  Dim oSld As Slide
  Dim oShp As Shape
  For Each oSld In ActivePresentation.Slides
    For Each oShp In oSld.Shapes
      If oShp.Type = msoPlaceholder Then
        If oShp.PlaceholderFormat.Type = ppPlaceholderSlideNumber Then
          oShp.TextFrame.TextRange.Text = "Page " & oSld.SlideIndex & " of " & ActivePresentation.Slides.Count
        End If
      End If
    Next
  Next
End Sub



Step 7 : Click on "run" macro.

Now you can see in footer with your  " Page 1 of 15 ".




Friday, August 5, 2016

amount convert to word by jquery

Jquery for amount convert to word

Ex : 1234 -> One thousand two hundread thirty four 

var th = ['', 'thousand', 'million', 'billion', 'trillion'];
var dg = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'];
var tn = ['ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'];
var tw = ['twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety'];

function toWords(s) {
    s = s.toString();
    s = s.replace(/[\, ]/g, '');
    if (s != parseFloat(s)) return ' ';
    var x = s.indexOf('.');
    if (x == -1) x = s.length;
    if (x > 15) return 'too big';
    var n = s.split('');
    var str = '';
    var sk = 0;
    for (var i = 0; i < x; i++) {
        if ((x - i) % 3 == 2) {
            if (n[i] == '1') {
                str += tn[Number(n[i + 1])] + ' ';
                i++;
                sk = 1;
            } else if (n[i] != 0) {
                str += tw[n[i] - 2] + ' ';
                sk = 1;
            }
        } else if (n[i] != 0) {
            str += dg[n[i]] + ' ';
            if ((x - i) % 3 == 0) str += 'hundred ';
            sk = 1;
        }
        if ((x - i) % 3 == 1) {
            if (sk) str += th[(x - i - 1) / 3] + ' ';
            sk = 0;
        }
    }
    if (x != s.length) {
        var y = s.length;
        str += 'point ';
        for (var i = x + 1; i < y; i++) str += dg[n[i]] + ' ';
    }
    return str.replace(/\s+/g, ' ');
}

jquery for decimal number validation

jquery for decimal number validation

$(document).ready(function () {
             SetNumber();
});
-----------------------------------
 
function SetDecimal() {

    $(".DecimalOnly").keydown(function (e) {
        var keyPressed;
        if (!e) var e = window.event;
        if (e.keyCode) keyPressed = e.keyCode;
        else if (e.which) keyPressed = e.which;
        var hasDecimalPoint = (($(this).val().split('.').length - 1) > 0);

        if (keyPressed == 46 || keyPressed == 8 || ((keyPressed == 190 || keyPressed == 110) && (!hasDecimalPoint)) || keyPressed == 9 || keyPressed == 27 || keyPressed == 13 ||
            // Allow: Ctrl+A
            (keyPressed == 65 && e.ctrlKey === true) ||
            // Allow: home, end, left, right
            (keyPressed >= 35 && keyPressed <= 39)) {
            // let it happen, don't do anything
            return;
        }
        else {
            // Ensure that it is a number and stop the keypress
            if (e.shiftKey || (keyPressed < 48 || keyPressed > 57) && (keyPressed < 96 || keyPressed > 105)) {
                e.preventDefault();
            }
        }
    });
}
 
<input type="textbox" id="txtage" class='DecimalOnly' />

jquery for number validation

jquery for number validation

$(document).ready(function () {
             SetNumber();
});
------------------------------------------
function SetNumber() {
    $(".NumbersOnly").keydown(function (e) {
        var keyPressed;
        if (!e) var e = window.event;
        if (e.keyCode) keyPressed = e.keyCode;
        else if (e.which) keyPressed = e.which;
        var hasDecimalPoint = (($(this).val().split('.').length - 1) == 0);

        if (keyPressed == 46 || keyPressed == 8 || ((keyPressed == 190 || keyPressed == 110) && (!hasDecimalPoint)) || keyPressed == 9 || keyPressed == 27 || keyPressed == 13 ||
            // Allow: Ctrl+A
            (keyPressed == 65 && e.ctrlKey === true) ||
            // Allow: home, end, left, right
            (keyPressed >= 35 && keyPressed <= 39)) {
            // let it happen, don't do anything
            return;
        }
        else {
            // Ensure that it is a number and stop the keypress
            if (e.shiftKey || (keyPressed < 48 || keyPressed > 57) && (keyPressed < 96 || keyPressed > 105)) {
                e.preventDefault();
            }        }
    });}

<input type="textbox" id="txtage" class='NumbersOnly' />