PDA

View Full Version : Problems with VBA code in Japanese version of Word



PKisielewski
06-26-2007, 12:28 PM
I am just wondering if anyone else has experienced a problem when they created a Word document that is using code in english which work in the English version (Canada and the USA) but not for others who have various language versions. The code is not working for individuals who are in Japan and Germany.
For example the code stopped - see highlighted below on the second .style = ..... is from a Japanese individual.

With Selection.Tables(1)
If .Style <> "Table Grid" Then
.Style = "Table Grid"
End If
.ApplyStyleHeadingRows = True
.ApplyStyleLastRow = True
.ApplyStyleFirstColumn = True
.ApplyStyleLastColumn = True
End With

Does anyone have any suggestions or help in this matter?:help

fumei
06-27-2007, 12:22 PM
Sorry, but there is no highlight.

.ApplyStyleLastRow = True

Is this the offending line? When you say "stop"...what does that mean exactly? I can't see the screen...is there an error message? It freeze with no error message?

Also, it is helpful if you tell us what version is being used.

PKisielewski
06-27-2007, 01:43 PM
second .style = ..... is from a Japanese individual.



No it is the second line .style .Style = "Table Grid"
that is highlighted in yellow.
The code stopped refers to when the user gets an error from selecting a command button and in this error message they select the debug button
which in turn takes them to the vb code with the highlighted text.

Hope that I have explained it better. The Word verision is 2002.

Thanks.

fumei
06-29-2007, 10:17 AM
Simply put, they do not have the Style "Table Grid". Although I would like to absolutely know that you DO have the Selection in a table.

BTW: when making a comment about error message, it is helpful if you can actually state the error message. Again, we can not see your screen.

My guess though is that there is no Table Grid style. This is surprising as it is a standard Word table style. But then, I am not familiar with non-English versions.

You could certainly add a test for the existence of the style, to be sure.