Results 1 to 6 of 6

Thread: [RESOLVED] Help with text formating from the past thread

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    109

    Resolved [RESOLVED] Help with text formating from the past thread

    Formating the text form here http://www.vbforums.com/showthread.php?t=403805 to (LOOK IN THE ATTACHMENTS) look like the one in Test.txt thanks.
    Attached Files Attached Files

  2. #2
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: Help with text formating from the past thread

    Here is code you need to modify in your previous code:
    VB Code:
    1. Private Sub UserForm_Activate()
    2.     Dim strFilter As String
    3.     Dim lngFlags As Long
    4.     Dim dlgOpen As FileDialog
    5.     Dim strTxtFile As String
    6.     Dim iFile
    7.     Dim strTemp As String
    8.  
    9.     strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")
    10.     strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
    11.  
    12.     Set dlgOpen = Application.FileDialog(Type:=msoFileDialogOpen)
    13.     strTxtFile = ahtCommonFileOpenSave(InitialDir:="C:\", Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, DialogTitle:="Save the Txt file As")
    14.     With dlgOpen
    15.         .AllowMultiSelect = True
    16.         If .Show = -1 Then
    17.             'Add headers
    18.             Call WriteTextFileContents("[Name:,File Size:,Number of Slide(s) Found:,Number of WordArt(s) found:,Number of TextBox found(s):," _
    19.                                        & "Number of Picture(s) found:,Number of AutoShape(s) found:,Number of Sound(s) & Video(s) file found:," _
    20.                                        & "Number of Diagram(s) found:,and Number of Chart(s) found:]" & vbCrLf, strTxtFile, True)
    21.  
    22.             'if the user press the Open button
    23.             For Each iFile In .SelectedItems
    24.                 ProgressBar1.Value = ProgressBar1.Value + (50 / .SelectedItems.Count)
    25.                 'To open the file
    26.                 Presentations.Open iFile
    27.  
    28.                 'Add the file Name
    29.                 strTemp = iFile & ","
    30.                 'Call WriteTextFileContents(iFile & vbCrLf, strTxtFile, True)
    31.  
    32.                 'Count the number of slides and store it in text file
    33.                 'remove comma at the end if not needed.
    34.                 strTemp = strTemp & Presentations(iFile).Slides.Count & ","
    35.                 'Call WriteTextFileContents(Presentations(iFile).Slides.Count & vbCrLf, strTxtFile, True)
    36.                 'No. of pictures ...
    37.                 'No. of sound ...
    38.                 'No. of video ...
    39.                 'etc.
    40.  
    41.                 'finally write everything in a text file
    42.                 Call WriteTextFileContents(strTemp, strTxtFile, True)
    43.  
    44.                 'To close the file
    45.                 Presentations(iFile).Close
    46.                 ProgressBar1.Value = ProgressBar1.Value + (50 / .SelectedItems.Count)
    47.             Next
    48.         End If
    49.     End With
    50.     'End Sub
    51.  
    52. ExitHere:
    53.     MsgBox "Process Completed."
    54.     Unload Me
    55. End Sub
    CS

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    109

    Cool Re: Help with text formating from the past thread

    Thanks a lot C man but where do I put it and how can I add a percentage to the progress bar, thanks again.

  4. #4
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: Help with text formating from the past thread

    you need to replace the similar code which i gave you last time

    percentage?????

    Do you mean numbers or something else?
    CS

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    109

    Arrow Re: Help with text formating from the past thread

    Quote Originally Posted by cssriraman
    you need to replace the similar code which i gave you last time

    percentage?????

    Do you mean numbers or something else?
    How come the ProgressBar doesn't work and how do I add number to the ProgressBar like percentage, also how come the Calculations is wrong. Here is the attachment that contains the code. Thanks a lot.
    Attached Files Attached Files
    Last edited by Kawser; May 12th, 2006 at 01:52 PM.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    109

    Re: Help with text formating from the past thread

    Thanks, C-MAN

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width