Error using SaveAs( ) with OLE control for MS-Word file

We have an application which inserts an MS-Word file into an OLE control and 
then reads the data from the OLE control and stores the data in the 
database. The stored data contains both the original data and the OLE 
header.



Blob lbl_ole_data



Ole20.InsertFile( as_filename)

lbl_ole_data = Ole20.objectdata



We have a second application which reads the data from the database into an 
OLE control and saves the original data to a file.



Blob lbl_ole_data



Ole20.objectdata = lbl_ole_data

Ole20.Activate(InPlace!)                                                  // 
this line is for testing only

Ole20.object.SaveAs( ls_tempfilename, AsStatement!)



This technique works fine when the original MS-Word files were created on my 
machine or on my colleague's machine. However, if the files were originally 
created on one of our customer's machines, PowerBuilder returns the 
following error.



"Error calling external object function saveas".



If I add the statement, Ole20.Activate(InPlace!), MS-Word is activated and 
opens the document successfully on my machine.



I set breakpoints in both the error event and the ExternalException event of 
the OLE control, but only the Error event is triggered.



Does anyone have any idea what might be causing the problem or how to get 
more information on what is causing the problem? Is there an alternative 
technique that I could use?



Thanks.



Regards,



Leonard Berman








0
Leonard
9/11/2009 6:44:19 PM
sybase.ole-ocx-activex 6324 articles. 0 followers. Follow

0 Replies
667 Views

Similar Articles

[PageSpeed] 31
Get it on Google Play
Get it on Apple App Store

Reply:

Similar Artilces:

MS-Word file open using OLE
I added an OLE, word document, object to a tab page. PB 10 (build 6064) script to open: li_result = parent.ole_letter.InsertClass ("Word.Document") li_result = parent.ole_letter.LinkTo (ls_file) li_result = parent.ole_letter.Activate (offsite!) The document opens fine but: 1. When I run PB in development mode and use the tab page then PB crashes. PB also crashes in development mode every time I modify any script any place on the tab page user object. If I export and import the tab page user object then the problem goes away. 2. Can I get word to open the doc...

PB6.5.1 errors using OLE printing via MS Word
Hi, I am trying to migrate an application from PB 5.0.02 (16 bit) to PB 6.5.1 (32 bit). One part of the application is giving me what seem to be random errors (I know, I know, they're not). This part uses MS Word for Windows 95 Version 7.0a to print a series of MS Word documents. While I've gotten three different errors (spanning three test PCs), the only one I can match up with a line of PowerBuilder code is one that uses the Word Basic FileOpen() command. The code has 1. The creation of an OLE object 2. ConnectToNewObject() is used to connect the object to Word....

OLE (MS-Word) Control
Hi everybody! I hope I say this all correctly, cause I have only about 6 months experience with PowerBuilder. I'm using version 6.5.1 of PowerBuilder... I have a datawindow where I have placed an OLE control (an MS-Word doc built in Office 97) in the detail band of the datawindow. The Word document is "linked" not "imbeded". The idea is to merge some addresses (Sybase columns) with the Word doc and print it. All of that works great, however once I print the datawindow (using PFC_PRINT), my mouse will appear normal, but clicking on anything, anywhere in...

OLE (MS-Word) Control
Hi everybody! I hope I say this all correctly, cause I have only about 6 months experience with PowerBuilder. I'm using version 6.5.1 of PowerBuilder... I have a datawindow where I have placed an OLE control (an MS-Word doc built in Office 97) in the detail band of the datawindow. The Word document is "linked" not "imbeded". The idea is to merge some addresses (Sybase columns) with the Word doc and print it. All of that works great, however once I print the datawindow (using PFC_PRINT), my mouse will appear normal, but clicking on anything, anywhere in...

OLE Word97 and ole objects vs ole controls
--------------50D299EA9D99A20C83E801AB Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I am new to OLE automation. I'm trying to connect to a word97 document and filling forms fields with information. I'm trying to use the following code. I'm getting the following error in my log file: DateTime: 10/27/99 18:32:07 Title: System Error Message: Error Number 36. Error text = Name not found accessing external object property object. Window/Menu/Object = w_ole_test. Error Object/Control = cb_okay. Script = clicked. Line in Script = 22. ...

OLE Word97 and ole objects vs ole controls
--------------50D299EA9D99A20C83E801AB Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I am new to OLE automation. I'm trying to connect to a word97 document and filling forms fields with information. I'm trying to use the following code. I'm getting the following error in my log file: DateTime: 10/27/99 18:32:07 Title: System Error Message: Error Number 36. Error text = Name not found accessing external object property object. Window/Menu/Object = w_ole_test. Error Object/Control = cb_okay. Script = clicked. Line in Script = 22. ...

Using MS Word as OLE server
I have some PB 6.5 script that needs to connect to both Word 97 and Word 2000 acting as an OLE server. (1) Even after reading the PB help, I'm still a bit confused about the difference between ConnectToObject and ConnectToNewObject. It seems that they both start the server application. Could someone help me understand? (2) I'm confused about what I use as the classname for Word. We used to have ConnectToObject("Word.Basic") but I think that was exclusively for Word 95. Do I need to use "Word.Application.8" for Word97 and "Word.Applicatio...

OLE
I am trying to call the MS Word SaveAs() function through OLE from within my application. Does anyone know what type the parameters are to this function? The parameters are: FileName, FileFormat, LockComments, Password, AddToRecentFiles, WritePassword, ReadOnlyRecommended, EmbedTrueTypeFonts, SavenativePictureFormat, SaveFormsData, SaveasAOCELetter If I call SaveAs(as_filename), it will save the document as a template (.dot). I want to save it as a .doc file. Thanks For word basic (word 95, not 97) oleobject.filesaveas(string-filename,0) lole_letter.filesav...

OLE Control Error in EXE file
We are using PB 6.0 Update. In development environment the application is running smoothly. But when I successfully generated an EXE file and run this to other PC, the OLE control give us an error message that denotes OLE property does not exist. We are using ctClip OLE control. I guess there is a library needed in the client installation. Any help is really appreciated. alvin aha@abacus.com.ph ...

Using OLE to open MS Word
I am using Powerbuilder 6.5.1 using OLE to open MS Word from an application but it does not appear to be working. Can anyone help? The user has WIndows 98 and using MS Word 2000. This was working on a previous installation of MS Word but has now installed 2000 and no longer works. Regards David Price Technical Support ABI Building Data Ltd www.abibuildingdata.com DDI: 0151 353 3506 FAX: 0151 353 3505 Word marks a document as "dirty" when the user makes any changes. It also has exclusive access to "dirty" documents, and shared access to "clea...

OLE Custom Control vs. OLE Control
I am using PB 6.0, and am hoping someone can explain something to me. I created a Standard Visual user object based on the olecontrol class (referencing Word). This is called an OLE Custom Control, or at least that's what the properties window says. Why is this different than a regular OLE control? Why is the objectdata attribute not valid? Why are some of the events missing (i.e. close, save, and rename)? These events automatically are included in a regular OLE control. Seems odd to me that you can't inherit from the base olecontrol object, but then again, OLE in gen...

Using Ms Word OLE in Powerbuilder??
I'v recently enherited a PowerBuilder app that strips data out of DB2 and inserts it into A Word mail/merge document for printing using OLE. It was built for use with Word 5.0. We've gone to Office 97. It no longer works (same old story). Here is the offending code: ole_document.ActiveDocument.Content.EditGoTo ("Include") ole_document.ActiveDocument.Content.LINEDOWN(1) ole_document.ActiveDocument.Content.InsertAfter(i_sAcctDetail) It stops on the first line and the error message says that the "EditGoTo property was not found" Can someone stear ...

Open MS Word Read only in OLE control
Hi, How can I open a word document in OLE control in READ ONLY mode?. Please give me the syntax of the command to use. Here is how I open the document. I am able to open the document, but in Read /Write mode. IF Len( ole_word.DocFileName ) < 2 OR ole_word.DocFileName <> ls_LocDocFile THEN ole_word.Clear() ole_word.InsertClass( "word.document" ) ole_word.Open( ls_LocDocFile) END IF Thanks a lot Vinod Thomas V Thomas wrote: > How can I open a word document in OLE control in READ ONLY > mode?. Please give me the syntax of the command to use. He...

App error using OLE and Word 97
Dear all, Anyone come across the following before and got a fix? I am getting an application error when accessing the VBE object within a Word document. The problem occurs as follows (please bear with me!) I am using PB (7.0.2 build 8011) under Windows NT 4 (SP5) and Word 97. I have an OLE control on a window with a hidden datawindow in it. I have knocked up an object which reads throught the datawindow and pushes the header and footer contents across to the word document header and footer and then loops through every row in the primary buffer and outputs that to the body...

Web resources about - Error using SaveAs( ) with OLE control for MS-Word file - sybase.ole-ocx-activex

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

TERROR IN JAKARTA: 'Situation under control' after explosions, gunfire erupt in Indonesian capital
At least six people are dead, including three police officers, after several explosions at the Sarinah shopping mall in an apparent multi-site ...

DFES downgrades bushfire in Dunsborough as it is contained, but not under control
A BUSHFIRE south of Dunsborough has been contained but is not yet under control.

Queensland police shut down out-of-control party in Berserker, Rockhampton
Police shut down a party of 150 young people who had gathered at a house in Berserker, Rockhampton on Friday night.

Contextual and Granular Notification Controls
... written a lot about notifications, at one point calling the notifications screen “my home screen.” But I don’t like how we are forced to control ...

ESI cost control and networks
There is an interesting discussion thread on Twitter about how the way Medicare for All saves money is by significantly reducing provider, device, ...

While No One Was Watching, Obama Took Control of the Courts
... and President Obama’s legacy.” It didn’t favor conservatives but there was a dramatic shift to the far left. The appellate is under the control ...

Sanders Backs Gun Control Legislation Ahead of Democratic Debate
Hillary Clinton's campaign calls her rival's move a "debate-eve conversion."

Apple has landed a very rare sponsorship deal to ensure it has control of the hottest ticket in San Francisco ...
Apple has signed up for the first time to become a sponsor of the Super Bowl Host Committee, Daniel Roberts at Yahoo Finance reported. It's ...

Leonardo DiCaprio: The Oscar stuff is ‘completely beyond my control at this point’
... last night’s London premiere of The Revenant . Leo is looking pretty good these days. He’s de-bloated, his facial hair is very much under control, ...

Resources last updated: 1/18/2016 2:09:14 AM