General information
Category:
COM/DCOM and OLE Automation
I just reviewed my code and found the syntax error:
Below I typed
oDoc.tables(lncustomertbl).cell(lncustcntr,5).range(wdCollapseend)
when I should have typed:
oDoc.tables(lncustomertbl).cell(lncustcntr,5).range.collapse(wdCollapseend)
But I still don't know what the code is to accomplish what I need. The code I have now makes everything non-bold, non-italic. I need to select the first line of text, then make it bold. Then I need to set a new range on the remaining text, and apply bold to that.
>I am attempting to change the text formatting of text that is within a cell of my table, via word automation. The code I have tried so far does not work. Here is what I want to do:
>
>I want to have the first line of text in my cell in bold and italics, then issue a carriage return, and then have the remaining text not bold, not italicized.
>The code I tried does not work - see below. the 'wdcollapseend' line gives me the error message 'does not support a collection'
>
>What is the proper syntax to get this to work?
>
> oDoc.tables(lncustomertbl).cell(lncustcntr,5).range.text=alltrim(currespmatr_customer.mrecommend)+ chr(13)
> oDoc.tables(lncustomertbl).cell(lncustcntr,5).range.bold= .t.
> oDoc.tables(lncustomertbl).cell(lncustcntr,5).range.italic= .t.
> *oDoc.tables(lncustomertbl).cell(lncustcntr,5).range(wdCollapseend) && got error 'does not support a collection'
> *oDoc.tables(lncustomertbl).cell(lncustcntr,5).range.bold= .f.
> *oDoc.tables(lncustomertbl).cell(lncustcntr,5).range.italic= .f.
> oDoc.tables(lncustomertbl).cell(lncustcntr,5).range.insertafter(alltrim(currespmatr_customer.mconcept))
>
>
>TIA
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only