A
AG
I am using automation from Access 2000 to create a new Word doc (2000-2003).
The doc consists of several sections with tables and footers. I can generate
and fill all data, text, etc with no problem on my machine and generate a
completed doc as desired.
However, on client's machine, the separate section footers do not behave as
desired.
Instead of creating a new footer, the previous footer is being modified with
the content intended for the new footer.
Here is a sniplet of code that I am using to add the new footer.
Yes, all objects are properly defined/instantiated. No errors are generated.
Selection.EndKey Unit:=wdStory
Selection.InsertBreak Type:=wdSectionBreakNextPage
mappWord.Visible = True
Selection.EndKey Unit:=wdStory '9/20/2007
If docWord.ActiveWindow.View.SplitSpecial <> wdPaneNone Then
docWord.ActiveWindow.Panes(2).Close
End If
If docWord.ActiveWindow.ActivePane.View.Type = wdNormalView _
Or docWord.ActiveWindow.ActivePane.View.Type = wdOutlineView Then
docWord.ActiveWindow.ActivePane.View.Type = wdPrintView
End If
docWord.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
If Selection.HeaderFooter.IsHeader = True Then
docWord.ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageFooter
End If
Selection.HeaderFooter.LinkToPrevious = False
On Error Resume Next
'I think the problem is related to this line. Client was generating error
'command not avaliable..' here
while I was not. Yet, I had similar footer problem without this line.
docWord.ActiveWindow.ActivePane.View.NextHeaderFooter
On Error GoTo ErrLine
Selection.WholeStory
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HeaderFooter.PageNumbers.Add PageNumberAlignment:= _
wdAlignPageNumberRight, FirstPage:=True
Selection.MoveLeft Unit:=wdCharacter, Count:=1
'do some formatting, type text etc. for footer
I am guessing that it is related to some option setting on client's machine.
Any help would be appreciated.
The doc consists of several sections with tables and footers. I can generate
and fill all data, text, etc with no problem on my machine and generate a
completed doc as desired.
However, on client's machine, the separate section footers do not behave as
desired.
Instead of creating a new footer, the previous footer is being modified with
the content intended for the new footer.
Here is a sniplet of code that I am using to add the new footer.
Yes, all objects are properly defined/instantiated. No errors are generated.
Selection.EndKey Unit:=wdStory
Selection.InsertBreak Type:=wdSectionBreakNextPage
mappWord.Visible = True
Selection.EndKey Unit:=wdStory '9/20/2007
If docWord.ActiveWindow.View.SplitSpecial <> wdPaneNone Then
docWord.ActiveWindow.Panes(2).Close
End If
If docWord.ActiveWindow.ActivePane.View.Type = wdNormalView _
Or docWord.ActiveWindow.ActivePane.View.Type = wdOutlineView Then
docWord.ActiveWindow.ActivePane.View.Type = wdPrintView
End If
docWord.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
If Selection.HeaderFooter.IsHeader = True Then
docWord.ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageFooter
End If
Selection.HeaderFooter.LinkToPrevious = False
On Error Resume Next
'I think the problem is related to this line. Client was generating error
'command not avaliable..' here
while I was not. Yet, I had similar footer problem without this line.
docWord.ActiveWindow.ActivePane.View.NextHeaderFooter
On Error GoTo ErrLine
Selection.WholeStory
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HeaderFooter.PageNumbers.Add PageNumberAlignment:= _
wdAlignPageNumberRight, FirstPage:=True
Selection.MoveLeft Unit:=wdCharacter, Count:=1
'do some formatting, type text etc. for footer
I am guessing that it is related to some option setting on client's machine.
Any help would be appreciated.