We are merging data with a Word doc. Depending on certain conditions, we insert a second doc at the bottom of the first and merge more data.
We have been using this this code, in a subroutine, to do this
Set objWord = GetObject(, "Word.Application") Set oDoc = objWord.ActiveDocument Do While TheEnd = False If rstC!AffNeeded1 = True Then objWord.ActiveDocument.Bookmarks("BottomBook").Select objWord.Selection.InsertBreak Type:=wdSectionBreakNextPage objWord.Selection.InsertFile FileName:= <FileName>
It looks like the doc may no longer be active in the Sub. Is there a way to activate it without openning a new instance or to keep it active when the subroutine is called?
Anyone have any thoughts?
This code has worked for 4 years and only started failing around 9/14.
Thanks
--------------------------------------------------------------------------------
Last edited by RayL; 09-28-2010 at 11:43 AM.
Hi and welcome to the board, Unfortunately
I]Your post does not comply with Rule 3 of our Forum [/I]RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
Quoting entire posts clutters the forum and makes threads hard to read !
If you are pleased with a member's answer then use the Star icon to rate it
Click here to see forum rules
It is also not a good idea to post the same question with the same text in 2 different forums.
Google will catch up with you.![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks