View Single Post
 
Old 08-12-2019, 05:02 AM
SamDsouza SamDsouza is offline Windows 10 Office 2013
Advanced Beginner
 
Join Date: Aug 2019
Posts: 71
SamDsouza is on a distinguished road
Default

Tried with both wdCollapseEnd and wdCollapseStart ' RED and Blue Respectively
Code:
With objRange
        .Collapse Direction:=wdCollapseEnd    'collapse the range
        .Text = txtword    'write to the range
        .Font.Name = "Tahoma"    'format the range
        .Font.Size = "12"
        .ParagraphFormat.SpaceAfter = 0
        .Collapse Direction:=wdCollapseEnd    'collapse the range
    End With
As coded by you With above, the range started immediately after CommandButton but completely New As Document1

but when i changed as below, the range was seen in completely New As Document1
Code:
With objRange
        .Collapse Direction:=wdCollapseStart    'starts the Range in NewPage
        .Text = txtword    'write to the range
        .Font.Name = "Tahoma"    'format the range
        .Font.Size = "12"
        .ParagraphFormat.SpaceAfter = 0
        .Collapse Direction:=wdCollapseEnd    'collapse the range
    End With
Any Possibility to add page 2 and to start the Range in Page 2 of the current document "C:\WordTrial\cmdBtnWord.docm"

Also with above coding trials. Observed one thing whenever Document1 or new document Opens with that one more document opens but without a Page and item in Ribbons are disabled. Could you explain why this happens ?
Reply With Quote