May 10th, 2006, 11:09 PM
#1
Thread Starter
Lively Member
May 11th, 2006, 01:43 AM
#2
Re: Help with text formating from the past thread
Here is code you need to modify in your previous code:
VB Code:
Private Sub UserForm_Activate()
Dim strFilter As String
Dim lngFlags As Long
Dim dlgOpen As FileDialog
Dim strTxtFile As String
Dim iFile
Dim strTemp As String
strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")
strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
Set dlgOpen = Application.FileDialog(Type:=msoFileDialogOpen)
strTxtFile = ahtCommonFileOpenSave(InitialDir:="C:\", Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, DialogTitle:="Save the Txt file As")
With dlgOpen
.AllowMultiSelect = True
If .Show = -1 Then
'Add headers
Call WriteTextFileContents("[Name:,File Size:,Number of Slide(s) Found:,Number of WordArt(s) found:,Number of TextBox found(s):," _
& "Number of Picture(s) found:,Number of AutoShape(s) found:,Number of Sound(s) & Video(s) file found:," _
& "Number of Diagram(s) found:,and Number of Chart(s) found:]" & vbCrLf, strTxtFile, True)
'if the user press the Open button
For Each iFile In .SelectedItems
ProgressBar1.Value = ProgressBar1.Value + (50 / .SelectedItems.Count)
'To open the file
Presentations.Open iFile
'Add the file Name
strTemp = iFile & ","
'Call WriteTextFileContents(iFile & vbCrLf, strTxtFile, True)
'Count the number of slides and store it in text file
'remove comma at the end if not needed.
strTemp = strTemp & Presentations(iFile).Slides.Count & ","
'Call WriteTextFileContents(Presentations(iFile).Slides.Count & vbCrLf, strTxtFile, True)
'No. of pictures ...
'No. of sound ...
'No. of video ...
'etc.
'finally write everything in a text file
Call WriteTextFileContents(strTemp, strTxtFile, True)
'To close the file
Presentations(iFile).Close
ProgressBar1.Value = ProgressBar1.Value + (50 / .SelectedItems.Count)
Next
End If
End With
'End Sub
ExitHere:
MsgBox "Process Completed."
Unload Me
End Sub
May 11th, 2006, 11:49 AM
#3
Thread Starter
Lively Member
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.
May 11th, 2006, 11:54 AM
#4
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?
May 11th, 2006, 11:58 AM
#5
Thread Starter
Lively Member
Re: Help with text formating from the past thread
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
Last edited by Kawser; May 12th, 2006 at 01:52 PM .
May 14th, 2006, 05:54 PM
#6
Thread Starter
Lively Member
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
Forum Rules
Click Here to Expand Forum to Full Width