G
George Lee
When using OrganizerCopy, if the style name is not found in the source
document, Word returns an error dialog. In a VBA application, is there anyway
to suppress this dialog and let the code continue without the user having to
click OK?
The sample code. The dialog after the gSourceWordApp.OrganizerCopy call but
before the If Err.Number = 4198 Then line.
On Error Resume Next
Dim styleName As String
styleName = "corporateNameStyle"
gSourceWordApp.OrganizerCopy Source:=sourceDocument.FindInFileName, _
Destination:=indexWordDocument.FullName, _
Name:=styleName, _
object:=wdOrganizerObjectStyles
If Err.Number = 4198 Then
gSourceWordApp.OrganizerCopy Source:=sourceDocument.FindInFileName, _
Destination:=indexWordDocument.FullName, _
Name:="Normal", _
object:=wdOrganizerObjectStyles
End If
document, Word returns an error dialog. In a VBA application, is there anyway
to suppress this dialog and let the code continue without the user having to
click OK?
The sample code. The dialog after the gSourceWordApp.OrganizerCopy call but
before the If Err.Number = 4198 Then line.
On Error Resume Next
Dim styleName As String
styleName = "corporateNameStyle"
gSourceWordApp.OrganizerCopy Source:=sourceDocument.FindInFileName, _
Destination:=indexWordDocument.FullName, _
Name:=styleName, _
object:=wdOrganizerObjectStyles
If Err.Number = 4198 Then
gSourceWordApp.OrganizerCopy Source:=sourceDocument.FindInFileName, _
Destination:=indexWordDocument.FullName, _
Name:="Normal", _
object:=wdOrganizerObjectStyles
End If