M
Marcel
Hi,
I've found some sample code to put some text into Word. I'm testing this
code to learn from it, but I can't find an explanation for the use of CType
in the following code. Can someone explain the use of CType?
app = CType(GetObject(Nothing, "Word.Application"), Word.Application)
app.Selection.Text = "Hi, this is text."
Also does:
app = GetObject(Nothing, "Word.Application")
app.Selection.Text = "Hi, this is text."
Both do work.
Regards,
Marcel
I've found some sample code to put some text into Word. I'm testing this
code to learn from it, but I can't find an explanation for the use of CType
in the following code. Can someone explain the use of CType?
app = CType(GetObject(Nothing, "Word.Application"), Word.Application)
app.Selection.Text = "Hi, this is text."
Also does:
app = GetObject(Nothing, "Word.Application")
app.Selection.Text = "Hi, this is text."
Both do work.
Regards,
Marcel