Thanks for the suggestion thus far, Gerry. Yes, I see that all of the formatting in the second document is getting blown out. I thought that just the headers would come in unformatted, but it looks like the formatting for the entire document is cleared out.
The same styles are being used in...
Hello,
I am working on a macro that will string a series of files together in a single new document. These files have their own header and footer settings and also have their own page numbers that must be persevered. However, when it currently inserts a new document, the page numbers and...
This method seem to do the trick. Thanks very much for your patience and help. I've been thrown into working on a pretty complex system and I'm sure I'll have other questions as time goes on. It's much appreciated to get help from the experts. Thanks again!
Manually inserting the page number from the Headers and Footers toolbar seems to add the correct page number. I would much rather have the page number be a field so that it will update properly if new pages are added to the document. Does anyone know a way to incorporate that into the above...
Problem number 2 (regarding the text not being flushed against the right side) was based on some tab stops in the document so I have solved that problem. I just need to figure out the page number and multiple style/formatting problems. If it would be easier, I can email you the changed file...
Gerry,
Thank you for the help thus far. When I ran the macro on the sample file that I attached, problems 1-3 are still happening.
I'm not even worrying about the formatting (problem 3) yet. I figure I'll take it one step at a time. I attached the file after I ran this macro. If you compare it...
Hello,
I have a Word XP macro that I am writing to add some dynamic information to a series of documents. One of the tasks is to recreate the headers and footers of each document based on the information for each specific report. For example, the report title, category, and month and year of...
fumei,
I also took a look at this thread here with your respose to a question about headers and footers of different types:
http://www.tek-tips.com/viewthread.cfm?qid=1435364&page=13
Since even, odd, and first page headers and footers are all different in my project and each header and footer...
Thanks again fumei. I think I've got enough to get going on this. You have been a terrific help.
And thanks, PHV. I'll be checking out NextStoryRange for sure!
Originally, I was simply doing a single search and replace in several documents. However, as the scope of the project at work evolved over the past few weeks, my task has grown more complex to what it is now. So among other things, I'm now going through documents and replacing several things in...
Ok, and from what I can gather, I can simply reuse that range to do another search and replace, right? I need to do a bunch of hidden text searches after that initial "Heading 1" replace. I can just keep resuing r, right?
I'm starting to see how using Word ranges could be very helpful. I did want to keep the same style so that second example you posted worked perfectly. Thank you.
Do you know of a good online resource or book that has information on the Word Range object?
fumei, using your suggestion above, I have a different sub where I would like to simply replace the first occurence of Heading 1 text with something else. I would need to do something like this, right?
Set wdDoc = wdApp.Documents.Open(path + "\" + FileName)
Set r = wdDoc.Range
With r.Find...
You're right, fumei. You did post the solution first. Thank you. I have wdApp created as an Object and then do a:
Set wdApp = CreateObject("Word.Application")
and everything seems to work now. Thanks again for your help.
Hello,
I have a macro that is technically being written for Excel XP, but the part of the program that isn't working involves searching a word document for a particular style.
The program loops through several thousand file paths and names in an excel document. Among other things, the program...
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.