• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 187
  • Last Modified:

Manage Word Session


I am working with a visual basic 6 application that open in a new word session width a document that i write...

This session is invisible..
The problem is: When an user open a new word document by doubleclick word use my session to open this... And closing this session, my application give me an error because server word does not exist...

It is possible lock my session only for me ???


1 Solution
Can you show some code on how you are creating the Word object and how you are closing it?

The error is because your program is trying to write by mistyke to the new document that had been opened...
Do you trying to write:
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

Most likely this is the problem....

kaiouAuthor Commented:
That is the code i use to open , close word session, and open a document:

in a class module (clsWD) i initialize application object

Public WithEvents wd As Word.Application

Private Sub Class_Initialize()
Set wd = New Word.Application
End Sub

Private Sub Class_Terminate()
wd.quit 0
Set wd=nothing
End Sub

When it is necessary i declare and initialize class.

dim objWD as clsWD

and unload with set objWD=nothing

Excuse me, but the problem is caused by user, that close the session word that i use, because it is not invisible.

I want open a word document with a new word session and not an already opened.

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now