List of publications
|Hyperlinks are to on-line versions of the article available to the general
To view/hide notes and information, click the publication title.
Books I've co-authored (German as well as English)
- "Office VBA Macros you can Use Today"
The book contains macros for use in every day tasks for the Office applications Excel, Word, Powerpoint, Outlook and Access. I wrote the chapter for Microsoft Word. Although the books is for "plug-and-play" macros, I built the chapter with an eye towards showing how to correctly use Word's object model. The order in which the macros are presented build on concepts presented in preceding macros, in the form of comments in the code.
Link for Amazon.com
- "Word Programmierung - Das Handbuch"
This is the book I've always wanted to write, because I haven't been able to buy it. Only Microsoft Press, Germany, was willing to take a chance on it, which is why it's only available in German. Back in the days of WordBasic, we had the "Word Developer's Kit", which not only covered all the programming Help topics, but also illustrated how to actually use them to accomplish certain kinds of tasks. There was also the "Hacker's Guide" that described what things didn't work, and how to get the job done, anyway. While there are many books that present a beginner's level of VBA, very few actually discuss the object model. But none of them reach the depth and breadth of the two older books.
My co-authors and I - all MVPs - have tried to bring some of this to those needing to automate the modern version of Word (2000 through 2003). Code samples are primarily in VBA; C# versions of key procedures are also included, to give the .NET developer a starting point.
Link for Amazon.de
- "Microsoft Word Das Profibuch"
November 2002 (out of print)
The concept behind this book is similar to that of the programming handbook: to present a collection of information on how to best use Word, aimed at the professional worker. It does contain lots of macro code, where the Word application provides no built-in means to accomplish a task. The book covers as many facets of Word as is possible to cram into 700 pages. Again, only MS Press, Germany, was willing to take a chance. All copies were sold, so it's now only available as a used book.
Link for Amazon.de
Articles published in cooperation with Microsoft on the msdn.microsoft.com website
- "Effectively Using ActiveX Form Controls in Microsoft Word"
- "Automating Word Tables for Data Insertion and Extraction"
MS Office Pro
[formerly Microsoft Office & Visual Basic for Applications Developer (MOD)]Originally, these articles were archived on-line; now, many are only available on a CD containing all Informant articles published through 2002. Where the article was bought by Microsoft for the MSDN site, there is a link to that article.
Informant Communications Group
What Word bookmarks are, what they can do, how to handle them, especially using VBA. Includes code for moving to Next/Previous bookmark in a document.
- Positioning Graphics
Dealing with graphic objects in Word.
A colleague pointed out that, while the code
Does indeed return all the shapes in all document headers and footers, the following code will return just the shapes in the particular header/footer. In other words, referring to the exact range will pick up only the Shapes anchored in the range.
A question came up in a Word newsgroup concerning Shapes on the second or following pages of a multipage document. If one programmatically changes the RelativeVerticalPosition to be relative to the page, the Shape jumps to the top of that page rather than staying in place. Here's are two bits of code to work around the problem.
The first one I have to thank MVP colleague Ibby for, this is certainly the fastest and most accurate approach:
'Constant value = 1
.PositionVertRel = wdRelativeVerticalPositionPage
The second one calculates the current position and sets the .Top property to move the Shape back to its original position. 1) The .Top property of a Shape positioned relative to the text is the position in relation to the anchor; 2) A Shapes .Anchor property returns a range, that in turn can be used to get the .Information(wdVerticalPositionRelativeToPage). Adding these two values, we get a .Top value for repositioning the graphic.
Dim selpos As Single
Dim anchorpos As Single
Dim selectedShape As Word.Shape
Set selectedShape = Selection.ShapeRange(1)
If selectedShape.RelativeVerticalPosition _
<> wdRelativeVerticalPositionPage Then
selpos = selectedShape.Top
anchorpos = _
.RelativeVerticalPosition = _
.Top = selpos + anchorpos
- Word Fields, Part I: Automate Word Documents with Minimal Code
How to use Word fields to automatically insert and update information in a document without using VBA or other programming code.
A reader kindly pointed out that there's a mistake in the logic used for Listing One - Create numbering sequences. The CreateStartNumDocProp procedure assumes that no custom document properties except for "StartNum" ones are present in the document. If other document properties already exist whose names do not start with "StartNum" the wrong property name could be generated. Here is slightly altered code that takes this into account.
Function CreateStartNumDocProp(ByVal sPropName, _
ByVal PropValue As Long) As String
Dim prop As Office.DocumentProperty
'If no DocProperties, or none with StartNum in name
'DocProperty name is StartNum1
If ActiveDocument.CustomDocumentProperties.Count = 0 Then
sPropName = "StartNum1"
'Otherwise, increment StartNum by 1
For Each prop In ActiveDocument.CustomDocumentProperties
If Left(prop.Name, 8) = "StartNum" Then
sPropName = "StartNum" & _
CStr(Val(Mid(prop.Name, 9)) + 1)
'sPropName has not been changed, no StartNum properties
'but other custom doc properties exist in document
If Len(sPropName) = 8 Then sPropName = "StartNum1"
'Create DocProperty and set value to
'number of selected paragraphs plus 1
Name:=sPropName, Type:=msoPropertyTypeString, _
Value:=CStr(PropValue + 1), LinkToContent:=False
CreateStartNumDocProp = sPropName
- Word Fields, Part II: Numbering Conundrums
How to use Word fields for special numbering requirements, such as relative cell references in Word tables, continuing numbering using letters as in Excel columns (AA, AB, AC instead of AA, BB, CC).
- Mail Merge Part I: Introduction and Data Integration
- From Word to... Getting Word Data into Access, Excel, etc.
Pinnacle Publishing, Inc.
More on the Report from Hell
How to handle page formatting in Word, manually and programmatically: sections, header & footers, page orientation, page numbering, and other page layouting questions.
Logical Expressions, Inc.
Back to the top