AnsweredAssumed Answered

vrf Save Word Problem

Question asked by VRFuser on Mar 1, 2004

<font size=2 face="sans-serif">Hi Vrf,</font>

<font size=2 face="sans-serif">        I am using the following code to save a bmp in word.</font>

<font size=2 face="sans-serif">Set App = CreateObject("Word.Application");</font>
<font size=2 face="sans-serif">App.Visible = TRUE;</font>
<font size=2 face="sans-serif">Set Doc = App.Documents.Add();</font>
<font size=2 face="sans-serif">Doc.Activate();</font>
<font size=2 face="sans-serif">Set Wnd = App.ActiveWindow;</font>
<font size=2 face="sans-serif">Set Sel = App.Selection;</font>
<font size=2 face="sans-serif">Sel.PageSetup.Orientation = wdOrientPortrait;</font>
<font size=2 face="sans-serif">Wnd.View.Type = 3; // wdPageView in Word97, wdPrintView in Word2000</font>
<font size=2 face="sans-serif">Sel.PageSetup.TopMargin = 40;</font>
<font size=2 face="sans-serif">Sel.TypeText(A);Sel.TypeText("  ....   ");Sel.TypeText(Part);Sel.TypeText("   ....   ");Sel.TypeText(Op);</font>
<font size=2 face="sans-serif">Set Bmp = Doc.Shapes.AddPicture(Leaks);</font>
<font size=2 face="sans-serif">Bmp.LockAspectRatio = False;</font>
<font size=2 face="sans-serif">Doc.Shapes.SelectAll( );</font>
<font size=2 face="sans-serif">Sel.ShapeRange.PictureFormat.TransparentBackground = msoTrue;</font>
<font size=2 face="sans-serif">Doc.SaveAs("C://Documents and Settings//BHC Components Ltd//My Documents//Vee Programs//"+A+".doc");</font>
<font size=2 face="sans-serif">App.Quit();</font>
<font size=2 face="sans-serif">        </font>
<font size=2 face="sans-serif">        Works fine 95% of the time.</font>

<font size=2 face="sans-serif">        But occasionally get the following error</font>

<font size=2 face="sans-serif">ActiveX object "Microsoft Word" returned error code :0x800a1420 (5152)</font>
<font size=2 face="sans-serif">ActiveX object retuned error message: This is not a valid file name.</font>
<font size=2 face="sans-serif">Try one of the following:</font>
<font size=2 face="sans-serif">* Check the path to make sure it was typed correctly,</font>
<font size=2 face="sans-serif">* Select a file from the list of files and folders.</font>
<font size=2 face="sans-serif">(C://DOCUMENTS AND SETTINGS/BHC COMPO...)</font>


<font size=2 face="sans-serif">Object title :Change background in "word"</font>
<font size=2 face="sans-serif">Object type : Formula</font>
<font size=2 face="sans-serif">In UserFunction: ShowOneGraph</font>

<font size=2 face="sans-serif">Error number : 553</font>

<font size=2 face="sans-serif">Has anybody out there come across this problem</font>
<font size=2 face="sans-serif">& is there a way to fix it?</font>

<font size=2 face="sans-serif">I am using Vee 6.0 with XP pro.</font>

<font size=2 face="sans-serif">Thanks for your help in advance.</font>

<font size=2 face="sans-serif">Gavin Candy.</font>
<font size=2 face="sans-serif">Quality Engineer.
BHC Aerovox Ltd
20-21 Cumberland Drive
Granby Industrial Estate
Weymouth
DT4 9TE
England

Tel:           ++44  1305 782871
Fax:          ++44  1305 760670
Email:        gavin.candy@bhc.co.uk
website:    http://www.bhc.co.uk</font>


---You are currently subscribed to vrf as: rsb@soco.agilent.comTo subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".To send messages to this mailing list,  email "vrf@agilent.com".  If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".  

Outcomes