Archive for the ‘Cloud’ Category

Free storage and backup in the Cloud

Wednesday, July 25th, 2012

Today, I discovered 4shared. 15GB free plus a desktop client that automatically syncs what you have in a folder to a server on the Internet. Just like Dropbox, SugarSync, and Google Drive.

I now have 15 + 9.4 + 8 + 5 = 37.4GB free and automatic backup. Not bad!

Update:
SkyDrive could have given me 25GB free space and Box 5GB, but SkyDrive does not have a desktop application for Windows XP (I still use the old operating system) and the desktop application from Box is not free.

Update2:
MediaFire gives you 50GB for free. You have to manually upload files, but  with the desktop application it just means select files and right-click. However, the help file says that MediaFire is meant for sharing, not for backup.

Update3:
Mozy gives you 2GB for free with manual backup or backup as many times per day as you like.

Cooperating with fellow teachers

Saturday, July 9th, 2011

How to.

Creating and naming 155 text documents

Sunday, June 12th, 2011

(This post is a continuation of this post.)

My idea is to create a spreadsheet with Open Office Calc (if the spreadsheet does not already exists), write a form letter with Open Office Writer, merge the data in the spreadsheet with the form letter, and finally print individual documents, one for each student.

The procedure for doing this is clearly explained here. Note the field called “filename”.

There is only one problem with this,  the option “Save as individual documents” doesn’t work any more. It is a recognised bug!

As far as I can see, MS Word 2003 does not have the option to save as individual documents.

One way to make this work is to do the mail merge manually in a macro. In a spreadsheet I have two columns, one for the name of the student and one for his form. The top row has “student” and “form” as heading for these columns.

A report template, called reportcardtemplate.doc has the text “<student>” and “<form>” and they will be replaced manually by the current row read in the spreadsheet. Actually, to make life simpler, I am reading the entire spreadsheet into an array first.

The manual mail merge will save the created documents into a folder bearing the name of their form and they will be named after the student. For example will John Lennon in form 9 have his report card saved in the folder “9″ and be called “John Lennon.doc”.

Here is the entire code:

Sub test01()

' better to redim the array as we go along
Dim arr(2000, 2) ' max 2000 students
' better to read the folder the current word document is sitting in
cmainfolder = "C:\Documents and Settings\Jan\Escritorio\BTS report card programs\creating 155 word documents\"

' better to ask for the template in a dialog box
ctemplate = "reportcardtemplate.doc"

' ask the user for a folder
cfolder = GetFolderName("Please choose a folder to put the form folders in")
'MsgBox cfolder

If cfolder = "" Then
  MsgBox "fin"  
  Exit Sub
End If

' bring the spreadsheet into an array
' make an excel object    
' add a reference to the Excel-library; use the menu Tools - References    
Dim xlApp As Excel.Application    
Dim xlWB As Excel.Workbook        

' set it equal to the excel file    
Set xlApp = CreateObject("Excel.Application")    
' MsgBox cmainfolder + "students.xls"    
Set xlWB = xlApp.Workbooks.Open(cmainfolder + "students.xls")   

' go through each row from row 2 and put it into an array    
r = 2    
With xlWB.Worksheets(1)
        While Cells(r, 1).Formula <> ""
            arr(r - 1, 1) = Cells(r, 1).Value
            arr(r - 1, 2) = Cells(r, 2).Value
            r = r + 1
        Wend
    End With

' close    
xlWB.Close False ' close the workbook without saving  
xlApp.Quit ' close the Excel application    
Set xlWB = Nothing    
Set xlApp = Nothing
nstudents = r - 2
' go in a loop for number of records in the spreadsheet
For i = 1 To nstudents
 ' open the template    
  Documents.Open FileName:=cmainfolder + ctemplate
  ' replace <student> with arr(i,1), replace <form> with arr(i,2)    
For Each myStoryRange In ActiveDocument.StoryRanges ' this is overkill
        With myStoryRange.Find 
           .Text = "<student>"
            .Replacement.Text = arr(i, 1)
            .Wrap = wdFindContinue ' not needed since there is only one case, but does not hurt
            .Execute Replace:=wdReplaceAll
            .Text = "<form>"
            .Replacement.Text = arr(i, 2)
            .Wrap = wdFindContinue ' not needed since there is only one case, but does not hurt
            .Execute Replace:=wdReplaceAll
        End With
     Next myStoryRange
     ' save the template in the folder arr(i,2) and call it arr(i,1).doc
     ' find the complete paths
     If Right(cfolder, 1) <> "\" Then
          cfolder = cfolder + "\"
     End If
     arr(i, 1) = cfolder + arr(i, 2) + "\" + arr(i, 1)
     arr(i, 2) = cfolder + arr(i, 2)

     ' check if the folder arr(i,2) exists, if it does not then create it
     If Len(Dir(arr(i, 2), vbDirectory)) = 0 Then
          MkDir arr(i, 2)
     End If
     ActiveDocument.SaveAs (arr(i, 1))
     ActiveDocument.Close
     ' end of loop
Next i
MsgBox "fin"
End Sub

What is missing from the above code is what is needed to ask the user for a folder: the general declarations, the function GetFolderName, and the procedure TargetFolderName, all given in the first post of this series.

Using GoogleDocs for creating report cards

Saturday, June 11th, 2011

(This post is a continuation of this post.)

When my school’s server was down I was asked what we could do to enable the teachers to enter grades for the report card.

We discussed three possibilities:

  1. Send all 155 documents to the teachers and afterwards copy and paste to create the report card for each student. If each student has 10 teachers we are talking about 1,550 copy and paste operations. Estimated time: 9 hours. Sanity value: Negative.
  2. Share the documents using Dropbox. Dropbox gives you 2GB for free file sharing. The teachers would have to download and install the software. To open the Word documents and save them they would need Word 2003 or something that would not change any formatting of the original documents. Only one teacher could edit a student at a time. Before they could start work they would have to wait for the 155 files to be downloaded. After making changes they would have to keep their Internet connection open till the changes were uploaded. This solution avoids the copying and pasting challenge, but requires quite a bit computer knowledge and software to work well. Also, what for teachers not running Windows?
  3. Upload the Word documents to GoogleDocs. This would not have any of the drawbacks illustrated for Dropbox. However, I have had an instance where I could not save my changes and had to start all over again. Would this happen a lot? A positive point was that two teachers could edit the same report card at the same time.

The decision was to try GoogleDocs.

Big was my surprise when I tried to upload the Word document and get it converted to GoogleDocs.

The four columns in the Word document converted into five in GoogleDocs and the column widths were all nonsense! I went back to the Word table to see if it had more than four columns. It did not.

Internet search revealed that GoogleDocs reportedly is not doing a good job converting tables. However, when I tried to import a table in a test document it did not add any columns.

I went back to the original table and discovered something strange. The same column had different width depending on which row you were in! The change occurred between Art & Design and Science.

When I selected the table all rows were selected, so it was one table and not two. When I looked at the properties of the columns I discovered that the box “Preferred width” was not checked.

When I centered the table and checked “Preferred width” the table looked normal in Word and was converted correctly in GoogleDocs. The challenge was to do these changes in a macro.

To make a long story short, I did not manage! I could center the table, but all my attempts to check the preferred width boxes were unsuccessful. I tried to copy the code that was created when I recorded the macro manually, but to no avail.

' set columns widths of second table to preferred width
' this code did not work, it gave the error message:        
' "Cannot access individual columns in this collection because the table has mixed cell width
'ActiveDocument.Tables(2).Columns(1).PreferredWidthType = wdPreferredWidthPoints
'ActiveDocument.Tables(2).Columns(1).PreferredWidthType = wdPreferredWidthPoints        
'ActiveDocument.Tables(2).Columns(1).PreferredWidth = CentimetersToPoints(2.8)        
'ActiveDocument.Tables(2).Columns(2).PreferredWidthType = wdPreferredWidthPoints        
'ActiveDocument.Tables(2).Columns(2).PreferredWidth = CentimetersToPoints(9)        
'ActiveDocument.Tables(2).Columns(3).PreferredWidthType = wdPreferredWidthPoints        
'ActiveDocument.Tables(2).Columns(3).PreferredWidth = CentimetersToPoints(3.3)        
'ActiveDocument.Tables(2).Columns(4).PreferredWidthType = wdPreferredWidthPoints        
'ActiveDocument.Tables(2).Columns(4).PreferredWidth = CentimetersToPoints(1)

I also tried things like this:

Selection.SelectColumn        
Selection.Columns.PreferredWidthType = wdPreferredWidthPoints        
Selection.Columns.PreferredWidth = CentimetersToPoints(2.83)                
Selection.Move Unit:=wdColumn, Count:=1        
Selection.SelectColumn        
Selection.Columns.PreferredWidthType = wdPreferredWidthPoints      
Selection.Columns.PreferredWidth = CentimetersToPoints(9.63)

Since time was of an essence I ran my macro and then checked the boxes manually for all 155 Word documents. It took about an hour and was no great fun. I am still curious of how it can be achieved and will update this post if I find out.

[Update: see this forum post]

A last problem was that the Word document used a table to position text, but wanted no table border. Conversion always gave a border. I tried to set the border size to zero in Word and several other things, but GoogleDocs always showed a border. Manually I had to go in to all 155 GoogleDocs documents to change the border color to white. The smallest border size in GoogleDocs os 0.5 pt, not 0 pt.

Of course, if the Word document was made with GoogleDocs conversion in mind no manual corrections would have been necessary.

Here is an example of what the report looks like in GoogleDocs.

The next post will look at how the 155 individual Word documents can be created and named using mail merge and/or vbscript. (After that, I will look at more sensible approaches to the whole report card business.)