By Andrew Savikas
Book Price: $24.95 USD
£17.50 GBP
PDF Price: $19.99
Cover | Table of Contents | Colophon
Sub) procedure. Each one begins with the
following line:Sub MacroName
End Sub
SetEditingView, in the template of
your choice
[Hack #50]
.
It sets all the viewing options listed above.Sub FileRevertToSaved( )
Dim sDocPath As String
Dim sDocFullName As String
sDocFullName = ActiveDocument.FullName
sDocPath = ActiveDocument.Path
If Len(sDocPath) = 0 Then
MsgBox "Can't revert a document that's never been saved."
Exit Sub
End If
If MsgBox("Really revert to last saved version? " & _
"(Can't be undone)", _
vbYesNo) = vbNo Then
Exit Sub
End If
Documents.Open FileName:=sDocFullName, Revert:=True
End Sub
FileRevertToSaved macro, as shown in Figure 2-10.
ReAssignFileOpen, in the template of your choice
[Hack #50]
:Sub ReAssignFileOpen( )
Dim sNewPath As String
Dim sCurrentPath As String
Dim sDefaultPath As String
Dim lResponse As Long
sNewPath = ActiveDocument.Path
' Current document must have been saved
' at least once to be in a folder
If Len(sNewPath) = 0 Then
MsgBox "Please save this document first.", vbExclamation
Exit Sub
End If
' Capture the default path by temporarily resetting the current one
sCurrentPath = Options.DefaultFilePath(wdDocumentsPath)
Options.DefaultFilePath(wdDocumentsPath) = ""
sDefaultPath = Options.DefaultFilePath(wdDocumentsPath)
' Restore to the current path
Options.DefaultFilePath(wdDocumentsPath) = sCurrentPath
' Prompt user to confirm change to current document's folder
lResponse = MsgBox("Really Change File...Open path to:" & _
vbCr & vbCr & _
sNewPath & "?" & _
vbCr & vbCr & _
"Press Cancel to reset to Default (" & sDefaultPath & ").", _
vbYesNoCancel)
' Process response
Select Case lResponse
Case Is = vbYes
Options.DefaultFilePath(wdDocumentsPath) = sNewPath
Case Is = vbNo
Exit Sub
Case Is = vbCancel
Options.DefaultFilePath(wdDocumentsPath) = sDefaultPath
End Select
End Subhttp://www.MouseTrax.com) generates an
easy-to-read Word document listing your current Options settings.
Part of the first page of a sample report is shown in Figure 2-14.
AllowAccentedUppercase, which has to do with how
Word treats accents over capital letters in French).
regedit to open the registry editor. Navigate to
the following key:HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\General\
DoNotDismissFileNewTaskPane and either delete it
or set its value to 0.
http://www.mvps.org/skp/fidcode.htm that lets
you browse all the Office faces, 100 at a time. The FaceID browser,
shown in Figure 2-24, displays as a separate
toolbar. When you hover your mouse over one of the buttons, the
program displays its face ID number as a ToolTip.
http://www.techsmith.com), offer inexpensive
image-editing tools.
Sub DisplayNewImage( ) Dim cbar As CommandBar Dim cbarctrl As CommandBarControl Dim pImage As IPictureDisp Dim pMask As IPictureDisp Dim sImageFile as String Dim sMaskFile as String sImageFile = "C:\Documents and Settings\My Documents\tarsier.bmp" sMaskFile = "C:\Documents and Settings\My Documents\mask.bmp" Set cbar = CommandBars.Add(Name:="My Picture", Position:=msoBarFloating) Set cbarctrl = cbar.Controls.Add(Type:=msoControlButton) Set pImage = stdole.StdFunctions.LoadPicture(sImageFile) Set pMask = stdole.StdFunctions.LoadPicture(sMaskFile) cbarctrl.Picture = pImage cbarctrl.Mask = pMask cbar.visible = True End Sub
Assistant.On = False
Filename property of the
Assistant object:Assistant.Filename = "OffCat.acs"
AddToRecentFiles property to prevent Word from
adding it to the MRU:Documents.Open FileName:="Foo.doc",_
AddToRecentFiles:=False
=rand( )
rand() function:=rand(paragraphs, sentences)
=rand( )
rand() function:=rand(paragraphs, sentences)
HKEY_CURRENT_USER\Software\Microsoft\Office\Version\Word\Options
NoFontMRUList and give it a value of
1.