[COLOR=#0000ff]Private Const READYSTATE_COMPLETE = 4
[/COLOR]
Private Sub UserForm_Initialize()
Dim str1, str2, str3 As String
Dim lngIndex As Long
Dim credit As Variant
Dim formwith, formheight As Single
Dim intUnit As Integer
Dim strTemp As String
[COLOR=#0000ff]Dim body As Object, text As String, html As String[/COLOR]
strTemp = "<html><head><script type=""text/javascript"" language=""JavaScript"" src=""[URL]http://www.informatik.uni-leipzig.de/~duc/amlich/JavaScript/amlich-hnd.js[/URL]"">" _
& "</script></head>" _
& "<script language=""JavaScript"">" _
& "setOutputSize(""big"");" _
& "document.writeln(printSelectedMonth());" _
& "</script>" _
& "<body BGCOLOR=""101C44"" TEXT=""#FFFFFF"" topmargin=""0"" leftmargin=""14""></body></html>"
intUnit = FreeFile
Open [COLOR=#ff0000]"f:\MySecretDocument.htm"[/COLOR] For Output As intUnit
Print #intUnit, strTemp
Close intUnit
Me.WebBrowser1.Navigate2 [COLOR=#ff0000]"f:\MySecretDocument.htm"
[/COLOR]Me.WebBrowser1.Visible = True
With Me
.StartUpPosition = 0
.Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width)
.Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height)
End With
[COLOR=#0000ff]Do Until Me.WebBrowser1.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
html = "<html><head><SCRIPT language=JavaScript type=text/javascript src=""[/COLOR][URL="http://www.informatik.uni-leipzig.de/~duc/amlich/JavaScript/amlich-hnd.js""></SCRIPT"][COLOR=#0000ff]http://www.informatik.uni-leipzig.de/~duc/amlich/JavaScript/amlich-hnd.js""></SCRIPT[/COLOR][/URL][COLOR=#0000ff]>" & _
"<STYLE type=text/css><!-- .tennam {text-align:center; font-size:150%; line-height:120%; font-weight:bold; color:#000000; background-color: #CCCCCC}.thang {font-size: 17pt; padding:1; line-height:100%; font-family:Tahoma,Verdana,Arial; table-layout:fixed}.tenthang {text-align:center; font-size:125%; line-height:100%; font-weight:bold; color:#330033; background-color: #CCFFCC}.navi-l {text-align:center; font-size:75%; line-height:100%; " & _
"font-family:Verdana,Times New Roman,Arial; font-weight:bold; color:red; background-color: #CCFFCC}.navi-r {text-align:center; font-size:75%; line-height:100%; font-family:Verdana,Arial,Times New Roman; font-weight:bold; color:#330033; background-color: #CCFFCC}.ngaytuan {width:14%; text-align:center; font-size:125%; line-height:100%; color:#330033; background-color: #FFFFCC}.ngaythang {background-color:#FDFDF0}.homnay " & _
"{background-color:#FFF000}.tet {background-color:#FFCC99}.am {text-align:right;font-size:75%;line-height:100%;color:blue}.am2 {text-align:right;font-size:75%;line-height:100%;color:#004080}.t2t6 {text-align:left;font-size:125%;color:black}.t7 {text-align:left;font-size:125%;line-height:100%;color:green}.cn {text-align:left;font-size:125%;line-height:100%;color:red}--></STYLE></head><body>"
[/COLOR][COLOR=#0000ff]Set body = Me.WebBrowser1.document.body
text = body.innerhtml
Set body = Nothing
text = Replace(text, "/f:/MySecretDocument.htm", "[URL]http://www.informatik.uni-leipzig.de/~duc/amlich/PHP/index.php[/URL]", , , vbTextCompare)
html = html & text & "</body></html>"
Kill "f:\MySecretDocument.htm"
Open "f:\MySecretDocument.htm" For Output As intUnit
Print #intUnit, html
Close intUnit
Me.WebBrowser1.Navigate2 "f:\MySecretDocument.htm"
[/COLOR]End Sub
Private Sub UserForm_Terminate()
Kill [COLOR=#ff0000]"f:\MySecretDocument.htm"[/COLOR]
End Sub