Thank you macropod
I kept trying to move the range instead of using the characters collection. Someone else had suggested using the characters collection, but I didn't know how to implement it. Thanks again, pjk
Thanks macropod, but I'm trying to accomplish this without using selection, just sticking to range. The inelegant code from the beginning of the post works, but by using selection as well.
The formula obviously yields an error because there isn't an integer after the + sign. I've been trying to insert the wdPageField into that position, without success. The results from the above is displayed as
{EQ=(0 + ) \*MERGEFORMAT}
I know what I want:
Page { =(intPgNo + {PAGE \*...
Gerry,
Thank you for your previous posts. I guess I didn't express myself clearly. The code shown above is what I'm trying to replace, not what I'm trying to use. I shouldn't even have included it in the post.
I'm trying to insert a formula with a embedded PAGE field.
I can add a formula...
Word VBA -How do I insert a formula into a header while still using range? I don't know how to start/end the formula field. I'm trying to insert:
Page { =(intPgNo + {PAGE \* MERGEFORMAT })}
The following works by switching to selection, but I have been unable to produce either the wdFieldEmpty...
I have created a VB application that reads source code used to program Automatic Test Equipment, plus a database describing the interfacing. The application then creates another database which details the test and path information. Eventually, the application creates a Word document containing...
This is the beginning code to establish the header:
Dim i As Integer, wpNum$, oHf As HeaderFooter, r As Word.Range
'-------------------------
'Clear out header / footer
'-------------------------
i = W.ActiveDocument.Sections.count
For Each oHf In...
I'm attempting to build a header with multiple font sizes and several fields. I'm using Word.Range, to set the specific header parameters. Using the range object makes formatting changes to the entire Header (the entire range), and inserted fields appear at the beginning of the header instead of...
Thank you very much Gerry. As you could tell, all of my Word code was based on incorporating recorded macros. Is there a reference (online or book) that demonstrates using objects for programming all of Word's functions? The Object Browser is helpful when you know what you're looking for, but...
The code from the original post is in subroutine SourceCodeHeaderSetup called from within the NewSection subroutine.
I'm using VB6, and the Word object is declared a W
This routine gets called as text files are read in and processed. Each file becomes a new section. The code at the end puts a...
Word VBA All versions through Office 2003 -
The document being generated uses "Different first page" headers for early sections. Switching to deselect "Different first page" in a later new Section header causes previous headers to switch to also reflect the same change, or to mangle the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.