Dec 22

Refresh Fields in Microsoft Word

The concept of having page numbers and other fields in Word to dynamically display information works and sounds great. The only drawback is getting the information to stay up to date. Yes, there is the F9 feature that refreshes all the selected fields. Having to remember to select all the text and then press F9 is not bad. But the headers and footers are not selected so they do not get updated. Each different header needs to be updated individually. This macro will update all the fields in each section of the active document.

Create Macro

  1. Select Tools – Macro – Macros from the menu bar
  2. Enter RefreshAllFields for the ‘Macro Name’
  3. Select ‘Normal.doc’ for ‘Macros in’
  4. Select ‘Create’ option
  5. Copy the following text between Sub and End Sub
  6. Paste into Visual Basic Editor
Sub RefreshAllFields()
 '
 ' RefreshAllFields Macro
 '
 '
 For i = 1 To ActiveDocument.Sections.Count
 	If Not ActiveDocument.Sections(i).Headers Is Nothing Then
 		For h = 1 To ActiveDocument.Sections(i).Headers.Count
 			x = ActiveDocument.Sections(i).Headers(h).Range.Fields.Update()
 			 Next h
 		End If
 		x = ActiveDocument.Range.Fields.Update()
 		If Not ActiveDocument.Sections(i).Footers Is Nothing Then
 			For f = 1 To ActiveDocument.Sections(i).Footers.Count
 				x = ActiveDocument.Sections(i).Footers(f).Range.Fields.Update()
 			Next f
 		End If
 	Next i
 End Sub

Run Macro

  1. Select Tools – Macro – Macros from the menu bar
  2. Select RefreshAllFields for List of macros
  3. Sit back and watch
I use this macro so often that I added it to my personal toolbar that is always displayed in every document.
Dec 17

One Teamstudio Icon

Updated version of One Teamstudio Iconis now available. If you have ever used Teamstudio you will notice there could eight different icons to choose from. Over the past four years that I have been using Teamstudio I have frequently clicked on the wrong icon. After wasting time to close down the tool and select a different one. I created one icon that would contain all options and prompt me which tool I wanted to open. So now I have something like this: The standard Teamstudio icons are on the right. The new icon will display the following prompt to select the tool to use. The other annoying thing about implementation Teamstudio’s tools is that they lock Designer while they are open. In one of Teamstudio’s beta release they were testing the ability to launch a tool in Modal mode which would not lock Designer. This was very nice feature, but it was not implemented because it had some bugs according to them. The one Teamstudio icon that I implemented uses the modal implementation and I never had a problem. For this article I have split up the code into three sections: Teamstudio Modal, Teamstudio Standard, and Original Teamstudio’s Posting. Use what ever fits your needs.

Teamstudio Modal (allows the use of Notes/Domino)

Option := @Prompt( [OKCANCELLIST] ; "Select Option" ; "What would you like to do:" ; "CIAO! Modal" ; "Analyzer Modal" : "Configurator Modal" : "CIAO! Modal" : "Delta Modal" : "Librarian Modal" : 
"Snapper" : "Form Snippet" : "Validator (Linkchecker) Modal" ) ;
 
 File := "Nothing";
 @If(
 Option = "Analyzer Modal" ; 
	@Command([Execute]; "ndean.exe"; @DbLookup ("NAME":"Nocache";"") ) ;
 Option = "Configurator Modal" ; 
	@Command([Execute]; "nconfy.exe";@DbLookup ("NAME":"Nocache";"") ) ;
 Option = "Delta Modal" ; 
	@Command([Execute]; "ndelta.exe";@DbLookup("NAME":"Nocache";"") ) ;
 Option = "CIAO! Modal" ; 
	@Command([Execute]; "nciao.exe";@DbLookup("NAME":"Nocache";"") ) ;
 Option = "Librarian Modal" ; 
	@Command([Execute]; "nlibr.exe";@DbLookup("NAME":"Nocache";"") ) ;
 Option = "Snapper" ; 
	@Set( File ; @DbColumn( "TMS":"NoCache" ; "SNAP") ) ;
 Option = "Form Snippet" ; 
	@Command( [FileImport]; "Form Snippet";"") ;
 Option = "Validator (Linkchecker) Modal" ; 
	@Command([Execute]; "nvalidator.exe";@DbLookup("NAME":"Nocache";"") ) ;
 "" );
 
 @If ( File != "Nothing" & Option = "Analyzer":"Linkchecker";
	 @Do(
		 @PostedCommand( [AddDatabase]; File );
		 @PostedCommand( [FileOpenDatabase]; File )
	 );
 "" )

Teamstudio Standard

Option := @Prompt( [OKCANCELLIST] ; "Select Option" ; 
 "What would you like to do:" ; "CIAO!" ; 
 "Analyzer": "Configurator" : "CIAO!" : "Delta" : "Librarian" : "Snapper" : 
 "Form Snippet" : "Validator 
 (Linkchecker)") ;
 
 File := "Nothing";
 @If(
 Option = "Analyzer" ; 
	@Set( File ; @DbLookup( "TMS" : "NoCache"; "DEAN" ) );
 Option = "Configurator" ; 
	@Set( File ; @DbLookup( "TMS" : "NoCache"; "STAR" ) ) ;
 Option = "Delta" ; 
	@Set( File ; @DbLookup( "TMS" : "NoCache"; "DIFF" ) ) ;
 Option = "CIAO!" ; 
	@Set( File ; @DbLookup( "TMS" : "NoCache"; "CIAO" ) ) ;
 Option = "Librarian" ; 
	@Set( File ; @DbLookup( "TMS" : "NoCache"; "LIBR" ) );
 Option = "Snapper" ; 
	@Set( File ; @DbColumn( "TMS":"NoCache" ; "SNAP") ) ;
 Option = "Form Snippet" ; 
	@Command( [FileImport]; "Form Snippet";"") ;
 Option = "Validator (Linkchecker)" ; 
	@Set( File ; @DbLookup( "TMS" : "NoCache";"LINKCHK" ) ) ;
 "" );
 
 @If ( File != "Nothing" & Option = "Analyzer":"Linkchecker";
	@Do(
		@PostedCommand( [AddDatabase]; File );
		@PostedCommand( [FileOpenDatabase]; File )
	);
 "" )

Original Teamstudio’s Posting

The current posting at Teamstudio for Run *Non-Modal* and *Modeless* Versions of Teamstudio Products from a Single Smarticon (You will need to log in) The link has the following disclaimer on it: [Editor's note: The modeless (or non-modal) versions of these Teamstudio for Notes products are not supported by the company. Under certain special circumstances crashes have occasionally been reported]
Option := @Prompt( [OKCANCELLIST] ; "Select Option" ; 
 "What would you like to do:" ; 
 "CIAO! Modal" ; "Analyzer" : "Analyzer Modal" : "Configurator Modal" : 
 "Configurator" : "CIAO!" : "CIAO! Modal" : "Delta" : "Delta Modal" : "Librarian"
 : "Librarian Modal" : "Snapper" : "Form Snippet" : "Linkchecker" ) ;
 File := "Nothing";
 @If(
 Option = "Analyzer" ; 
	@Set( File ; @DbLookup( "TMS" : "NoCache"; "DEAN" ) );
 Option = "Analyzer Modal" ; 
	@Command([Execute]; "ndean.exe"; @DbLookup ("NAME":"Nocache";"") ) ;
 Option = "Configurator" ; 
	@Set( File ; @DbLookup( "TMS" : "NoCache"; "STAR" ) ) ;
 Option = "Configurator Modal" ; 
	@Command([Execute]; "nconfy.exe";@DbLookup ("NAME":"Nocache";"") ) ;
 Option = "Delta" ; 
	@Set( File ; @DbLookup( "TMS" : "NoCache"; "DIFF" ) ) ;
 Option = "Delta Modal" ; 
	@Command([Execute]; "ndelta.exe";@DbLookup("NAME":"Nocache";"") ) ;
 Option = "CIAO!" ; 
	@Set( File ; @DbLookup( "TMS" : "NoCache"; "CIAO" ) ) ;
 Option = "CIAO! Modal" ; 
	@Command([Execute]; "nciao.exe";@DbLookup("NAME":"Nocache";"") ) ;
 Option = "Librarian" ; 
	@Set( File ; @DbLookup( "TMS" : "NoCache"; "LIBR" ) );
 Option = "Librarian Modal" ; 
	@Command([Execute]; "nlibr.exe";@DbLookup("NAME":"Nocache";"") ) ;
 Option = "Snapper" ; 
	@Set( File ; @DbColumn( "TMS":"NoCache" ; "SNAP") ) ; 
 Option = "Form Snippet" ; 
	@Command( [FileImport]; "Form Snippet";"") ;
 Option = "Linkchecker" ; 
	@Set( File ; @DbLookup( "TMS" : "NoCache";"LINKCHK" ) ) ;
 "" );
 
 @If ( File != "Nothing" & Option = "Analyzer":"Linkchecker";
	 @Do(
		 @PostedCommand( [AddDatabase]; File );
		 @PostedCommand( [FileOpenDatabase]; File )
	 );
 "" )