A
aolson
First of all i am pretty new to VB .NET as a whole so my answer may be
silly as may my questions.
Here is what i would like to do. I would like to open potentially
multiple word documents for viewing only in a tab control. Each Word
document should open in its own tab. Sometimes there may be only 1
document to open, sometimes there may be 5.
I have gotten my app to create the necessary tabs but I can't get more
than one word document to open utilizing the Web Browser object. I am
using an arraylist to store the documents i need to open. If multiple
exist it will open the first one in the first tab, but errors out
stating "Exception of type InvalidActiveXStateException was thrown."
when trying to open the second word doc in the secon tab. Any
suggestions on if this is possible or another way of doing it? Here is
my code:
Try
Dim i As Integer = 0
Dim tbTestTab As TabPage
Do While i < aryTest.Count
tbTestTab = New TabPage
TabControl1.Controls.Add(tbTestTab)
tbTestTab.Name = "tbTab" & i
tbTestTab.Text = "Tab " & i
Dim browser As New AxSHDocVw.AxWebBrowser
browser.Size = New System.Drawing.Size(400, 350)
tbTestTab.Controls.Add(browser)
browser.Navigate2(aryTest(i))
i = i + 1
Loop
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Thanks for the assistance and please let me know if there is something
i should be doing differently as this stuff is new to me. Thanks.
silly as may my questions.
Here is what i would like to do. I would like to open potentially
multiple word documents for viewing only in a tab control. Each Word
document should open in its own tab. Sometimes there may be only 1
document to open, sometimes there may be 5.
I have gotten my app to create the necessary tabs but I can't get more
than one word document to open utilizing the Web Browser object. I am
using an arraylist to store the documents i need to open. If multiple
exist it will open the first one in the first tab, but errors out
stating "Exception of type InvalidActiveXStateException was thrown."
when trying to open the second word doc in the secon tab. Any
suggestions on if this is possible or another way of doing it? Here is
my code:
Try
Dim i As Integer = 0
Dim tbTestTab As TabPage
Do While i < aryTest.Count
tbTestTab = New TabPage
TabControl1.Controls.Add(tbTestTab)
tbTestTab.Name = "tbTab" & i
tbTestTab.Text = "Tab " & i
Dim browser As New AxSHDocVw.AxWebBrowser
browser.Size = New System.Drawing.Size(400, 350)
tbTestTab.Controls.Add(browser)
browser.Navigate2(aryTest(i))
i = i + 1
Loop
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Thanks for the assistance and please let me know if there is something
i should be doing differently as this stuff is new to me. Thanks.