you wrote an application that works with Word object?
the application crashes in the middle of the run, after the debug you find that it crashes on this line:
WordObj.Selection.Find
well, it's not your fault, it's a microsoft bug. now, how you resolve it??
it's a tricky way,
what you should do is late binding
u should dim your word object as an General object and create it manualy, not by "new word"
here is a usefull code:
...
Dim wrdDoc As Object ' setting the word object as a general object
Dim IsWordRunning As Boolean
IsWordRunning = ApplicationIsRunning("Word.Application")
If IsWordRunning = True Then ' do
Set wrdApp = GetObject(, "Word.Application")
Else
Set wrdApp = CreateObject("Word.Application")
End If
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Open(filename)
...
and here is the applicationisrunning function:Function ApplicationIsRunning(ApplicationClassName As String) As Boolean
' returns True if the application is running
' example: If Not ApplicationIsRunning("Outlook.Application") Then Exit Sub
Dim AnyApp As Object
On Error Resume Next
Set AnyApp = GetObject(, ApplicationClassName)
ApplicationIsRunning = Not AnyApp Is Nothing
Set AnyApp = Nothing
On Error GoTo 0
End Function
Monday, July 02, 2007
Selection.Find crash
Posted by
RamiX
at
1:55 PM
0
comments
Labels: office, source codes, vb, vb.net, vb6, visual basic, visual studio, word
Thursday, August 03, 2006
Publishing .net WebApplicatuib
if you are tring to publish a .net webApplication, it doesn't matter if it's c# or VB.net you should do the following steps :
1. copy the files tin your projects
you don't need to copy them all, only the aspx, and the congidurations files and very important is to copy the bin directory other wise you'll get theis error message:
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Could not load type 'AppName.Global'.
2.Create Virtual Directory
this is a very important step, alot of people loose aloth of time untill they knwo they should do it (at least i did :)
go to the iis, stand on the default webSite (in the websites) and right click and the new virtual director.
if you don;t do this step so you will get the following error message:
An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Posted by
RamiX
at
10:17 AM
0
comments
Labels: asp.net, c#, vb.net, visual studio
Thursday, May 18, 2006
Request for the permission of type System.Net.WebPermission
your spent too much time on tring tounderstand why your application dons'nt work?? yea tell me about it, security request ...
i'm looking for it two weeks ago.. no one has no idea! until i foud this blog... http://blogs.conchango.com/kenibarwick/archive/2004/11/05/195.aspx
he said it simple! don't put your aplication on shared folder....
i stored my application on a mapped drive on my network!!
so if you did like me just copy the folder to your C drive and it's work properly!
http://www.byramix.com
Posted by
RamiX
at
11:48 AM
0
comments
Labels: c#, vb.net, visual studio, windows programming
