MS Office

Office: check if PowerPoint is running

Sunday, January 20th, 2008

Dim objAPP, sMsg
On Error Resume Next
Set objAPP = GetObject(, “PowerPoint.Application”)
If TypeName(objAPP) = “Empty” Then
    sMsg = “not started”
Else
    sMsg = “started”
End If
MsgBox “PowerPoint is ” & sMsg, vbInformation, “PowerPoint”
if sMsg = “started” then objAPP.Visible = true

MS Word: replace spaces to non-breaking

Thursday, January 10th, 2008

To insert it manually, use Ctrl+Shift+Space

Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles(”Normal”)
Selection.Find.Replacement.ClearFormatting
With Selection.Find
   .Text = “   ”
   .Replacement.Text = “^s”
   .Forward = True
   .Wrap = wdFindContinue
   .Format = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

Keep on coding