|
-
July 22nd, 1999, 03:50 PM
#1
OLE Control
OS is NT4. App. in VB5.
I have a form with OLE Control named frmPDOC_OBJECT.
I use ReadFromFile/SaveToFile to Initialise/Save the OLE Control.
The inserted object is a Microsoft Word Document.
I use
frmPDOC_OBJECT.DoVerb vbOLEOpen
to Open and Edit the Object in the OLE Control.
I use the following Code Segment to replace MailMerge text
in the Word Document with values from my Application.
*****
Dim DocObj As Object
Set DocObj = frmPDOC_OBJECT.object.Application.WordBasic
DocObj.editreplace "ptProjectGenNbr", CStr(flProjGenNbr), 0, 0, 0, 0, 0, 0, 0, 1, 0, 1
*****
The above code segment works well on some PC's and in other PC's it generates the following
error on the "Set DocObj = " and "DocObj.editreplace" statement.
91 Object variable or With block variable not set
In all PC's the statement "Object.Doverb vbOLEOpen" works fine and the
document contained in the OLE Control is displayed using Microsoft Word.
Further in one PC if I login as a regular user(who is in the Administrator Group in the PC), I get the above detailed error. But if I login in the same PC as "Administrator" the MailMerge routine is completed without any error.
If you have encountered the above/similar problem please reply to me on fixing the problem.
Thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|