New topic: 

WordApplication IllegalCastException

<http://forums.realsoftware.com/viewtopic.php?t=26236>

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       breamer           Post subject: WordApplication 
IllegalCastExceptionPosted: Wed Jan 28, 2009 10:07 am                        
Joined: Thu Dec 22, 2005 9:58 am
Posts: 46              I am generating a word document and some of it works but 
I am trying to make a selection "bold"

Here is code snippet:

  Dim word     AS  WordApplication
  Dim doc    AS  WordDocument
  Dim style    AS  WordStyle
  Dim v      AS  Variant
  Dim p      AS  INTEGER
  word =     NEW WordApplication
  DIM mytext   AS STRING
  DIM rng    AS  range
  word.visible = True
  word.Documents.Open("C:\4WardExecutable\4Ward_Template.docx")
  doc = word.ActiveDocument
  
  rng = doc.Content
  

Then it gets to the last line, I get "An exception of class 
illegalCastException was not handled"

Any ideas?   
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]     

-- 
Over 900 classes with 18000 functions in one REALbasic plug-in. 
The Monkeybread Software Realbasic Plugin v8.1. 

&lt;http://www.monkeybreadsoftware.de/realbasic/plugins.shtml&gt;

[email protected]

Reply via email to