Calcetines Extreme

Calcetines Extreme
Take care of you using the best socks

Monday, April 22, 2013

how to export all notes to a excel from a power point ?

we need to export all notes from a powerpoint to a text file.

create a macro calling code editor with ALT+F11 and insert the next code:

Option Explicit

Sub ExportNotesText()

    Dim oSlides As Slides
    Dim oSl As Slide
    Dim oSh As Shape
    Dim strNotesText As String
    Dim strFileName As String
    Dim intFileNum As Integer
    Dim lngReturn As Long

    ' Get a filename to store the collected text
    strFileName = InputBox("Enter the full path and name of file to extract notes text to", "Output file?")

    ' did user cancel?
    If strFileName = "" Then
        Exit Sub
    End If

    ' is the path valid?  crude but effective test:  try to create the file.
    intFileNum = FreeFile()
    On Error Resume Next
    Open strFileName For Output As intFileNum
    If Err.Number <> 0 Then     ' we have a problem
        MsgBox "Couldn't create the file: " & strFileName & vbCrLf _
            & "Please try again."
        Exit Sub
    End If
    Close #intFileNum  ' temporarily

    ' Get the notes text
    Set oSlides = ActivePresentation.Slides
    For Each oSl In oSlides
        strNotesText = strNotesText & "======================================" & vbCrLf
        strNotesText = strNotesText & SlideTitle(oSl) & vbCrLf
        strNotesText = strNotesText & NotesText(oSl) & vbCrLf
    Next oSl

    ' now write the text to file
    Open strFileName For Output As intFileNum
    Print #intFileNum, strNotesText
    Close #intFileNum

    ' show what we've done
    lngReturn = Shell("NOTEPAD.EXE " & strFileName, vbNormalFocus)

End Sub
Function SlideTitle(oSl As Slide) As String
    Dim oSh As Shape
    For Each oSh In oSl.Shapes
        If oSh.Type = msoPlaceholder Then
            If oSh.PlaceholderFormat.Type = ppPlaceholderTitle _
                Or oSh.PlaceholderFormat.Type = ppPlaceholderCenterTitle Then
                If Len(oSh.TextFrame.TextRange.Text) > 0 Then
                    SlideTitle = oSh.TextFrame.TextRange.Text
                    SlideTitle = "Slide " & CStr(oSl.SlideIndex)
                End If
                Exit Function
            End If
        End If
End Function

Function NotesText(oSl As Slide) As String
    Dim oSh As Shape

    For Each oSh In oSl.NotesPage.Shapes
        If oSh.PlaceholderFormat.Type = ppPlaceholderBody Then
            If oSh.HasTextFrame Then
                If oSh.TextFrame.HasText Then
                    NotesText = oSh.TextFrame.TextRange.Text
                End If
            End If
        End If
    Next oSh
End Function

Saturday, April 13, 2013

Translate back office tab texts like "Manufacturers"

You need to change some back office labels or text on admin menu, like Catalog, Orders, etc...

you will are not able to do that trough translation files, the only possibility is to change directly inside database, you have to search for "ps_tab_lang" and change all texts that you need here.

How to debug prestashop errors like error "product()"

i get a problem while trying to duplicate an exiting item, the error message is not clear i only can see "product()", for that i have to search something to debug that problem.

search located in the /config directory and change a parameter 
define('PS_MODE_DEV', false);
define('PS_MODE_DEV', true);
now you will able to see the error on sentence like thins:
"....Unknown column 'redirect_type' in 'field list'INSERT INTO `ps_product` (`id_shop_default`, `id_manufacturer`, `id_supplier`, `reference`, `...."

Thursday, April 4, 2013

avoid to send any mail on user registration


When any user is registred on joomla, beside you disable email registration, the system is sending an e-mail to administrator for new user details; we need to avoid that send mail function.


Acces to file "controller.php" on path "components/com_user" and edit the next line:

UserController::_sendMail($user, $password);

// UserController::_sendMail($user, $password);