Hi,
Hopefully I post it in the right forum.
I have a userform in a Word 2010 application with a webbrowser object in it.
Before i show this userform, i create the needed HTML code to open in the webbrowser.
The HTML code represent a labelsheet (A4), and the table rows & columns varry with the selected label sheet.
Obvious, this depends on the number of labels across and down on the label sheet.
In fact, it's only a table with a button in each table cell.
Because there's no Click event in the webbrowser object, I can't get its Row / Column value when I click in a table cell.
The probem i have is that i can't figure out what the HTML syntax is to run a subroutine from within the same userform.
The purpose is to retreive the table row & column number when i click a button.
the OnClick line give me always an error like:
Error 20 Permission denied
line: 45
char: 30
error: Expected ";"
code: 0
URL: .....
when i remove this line i don't get this error anymore.
I would appreciate it if anyone can help me to solve this problem.
here's part of the generated HTML code:
<!DOCTYPE html>
<html>
<head>
<style>
* {
padding: 0;
margin: 0;
}
body {
background-color: linen;
margin: 1em;
}
table tr td { text-align: center; }
/* Selected cell background = green */
table tr td.SelectedCell {
background-color: #4CAF50;
font-size: 1em;
color: Blue;
height: 24px;
width: 47px;
text-align: center;
border: 1px solid #FF0000;
}
/* Empty cell background = Gray */
table tr td.EmptyCell {
background-color: #808080;
font-size: 1em;
color: Red;
height: 24px;
width: 47px;
text-align: center;
border: 1px solid #FF0000;
}
</style>
</head>
<body>
<table>
<tr>
<td class= "SelectedCell">
<input type='button';
onClick='Application.Run "'New Label printer -6AB.docm'!StartHere.GetSelectedTableCellCoordinates"'; [B][COLOR=#FF0000]<<< Error here[/COLOR][/B]
class='button';
value=☺>
</td>
<td class= "EmptyCell">
<input type='button';
onClick='Application.Run "'New Label printer -6AB.docm'!StartHere.GetSelectedTableCellCoordinates"'; [B][COLOR=#FF0000]<<< Error here[/COLOR][/B]
class='button';
value=☹>
</td>
<td class= "EmptyCell">
<input type='button';
onClick='Application.Run "'New Label printer -6AB.docm'!StartHere.GetSelectedTableCellCoordinates"'; [B][COLOR=#FF0000]<<< Error here[/COLOR][/B]
class='button';
value=☹>
</td>
<td class= "EmptyCell">
<input type='button';
onClick='Application.Run "'New Label printer -6AB.docm'!StartHere.GetSelectedTableCellCoordinates"'; [B][COLOR=#FF0000]<<< Error here[/COLOR][/B]
class='button';
value=☹>
</td>
</tr>
Display More
and here's the test code from the Word subroutine that need to run when click on a button (need to be tuned).
Sub GetSelectedTableCellCoordinates()
'get the selected HTML table Row & Column values
'and place them in the apropriate textboxes
With frmLabelPosition
.tbRow = gintTableRow
.tbColumn = gintTableColumn
Debug.Print "Table Row = " & .tbRow
Debug.Print "Table Column = " & .tbColumn
End With
End Sub
Display More