#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Word.Range

Hi all,

I found several post here describing how to declare a range in Word.
But when itried to declare a word range (Dim myRange As Word.Range) it
gives me an error !?

I am using office 2003 with windows xp.

I could not select a paragraph in word for formatting or my desired
format does not work in word.

With WDApp
.Documents.Add
With .Selection
.TypeText Text:=A
.Font.Name = "Simplified Arabic"
.Font.Size = 18
.Font.Bold = True

.ParagraphFormat.Alignment = 1

.TypeParagraph

.ParagraphFormat.Alignment = 2
.TypeParagraph
.Font.Size = 14
.Font.Bold = False
.Font.Name = "Simplified Arabic"
.TypeText Text:=B
.TypeParagraph

If CmbPrint = "Arabic + Malayalam" Then
.TypeParagraph
.ParagraphFormat.Alignment = 0
.Font.Size = 14
.Font.Bold = False
.Font.Name = "ML-TTKarthika"
.TypeText Text:=C

ElseIf CmbPrint = "Arabic + English" Then
.TypeParagraph
.ParagraphFormat.Alignment = 0
.Font.Name = "Times New Roman"
.Font.Bold = False
.Font.Size = 11
.TypeText Text:=C

ElseIf CmbPrint = "Arabic + Urdu" Then '
.TypeParagraph
.ParagraphFormat.Alignment = 2
.Font.Name = "HUrdu Nastaliq"
.Font.Bold = False
.TypeText Text:=C
.Font.Size = 16
End If

End With

Here Arabic and Urdu are right to left and English and Malayalam left
to right

When it write the data to word one my fist part (text A) only three
charecters are font size 18 and remaining default. Also text B and C
also not giving me desired formatting.

any help?

TIA
Soniya

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Word.Range

Hi
Don't know how much help this might be but one way to specify a range
is

Set Testdoc = WDApp.Documents.Add
With Testdoc
.Activate
Set myRange = .Range(.Paragraphs(1).Range.Start,
..Paragraphs(4).Range.End)
end with

gives you a range object consisting of everything from the start of
Paragraph(1) to the end of Paragraph(4).
Now try a With myRange... instead of selection.

Completely untested!
regards
Paul

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find the first Word in a range ? BaggieDan Excel Discussion (Misc queries) 3 July 10th 09 08:27 AM
Inserting Excel Range into Word cmurphy Excel Programming 2 July 11th 05 07:30 PM
how to check if range contains particular word Sunil Patel Excel Programming 2 July 3rd 05 03:32 PM
Getting a range from Excel into a Word document daniB[_6_] Excel Programming 0 February 12th 04 02:40 PM
Pasting a Range to Word Ian Mangelsdorf Excel Programming 0 January 22nd 04 12:34 AM


All times are GMT +1. The time now is 07:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"