Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-12-2012, 02:11 AM
ramsgarla ramsgarla is offline Unable to retain Bulleted lists when pasted from RTF to word 2010 Windows 7 64bit Unable to retain Bulleted lists when pasted from RTF to word 2010 Office 2010 64bit
Novice
Unable to retain Bulleted lists when pasted from RTF to word 2010
 
Join Date: Sep 2012
Posts: 21
ramsgarla is on a distinguished road
Default Unable to retain Bulleted lists when pasted from RTF to word 2010

I am trying to paste Bulleted lists from RTF document to Word 2010
programatically using vb.net, but the bulleted lists are getting pasted as normal text.



Please advise as to how to retain bulleted lists while pasting from RTF document to Word 2010.

Any code snippets would be of great help.
Reply With Quote
  #2  
Old 10-14-2012, 10:32 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Unable to retain Bulleted lists when pasted from RTF to word 2010 Windows 7 64bit Unable to retain Bulleted lists when pasted from RTF to word 2010 Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 4,000
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

Which code are you using? Are you sure that you are pasting in rich text format (as opposed to plain text format)?
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #3  
Old 10-15-2012, 01:14 AM
ramsgarla ramsgarla is offline Unable to retain Bulleted lists when pasted from RTF to word 2010 Windows 7 64bit Unable to retain Bulleted lists when pasted from RTF to word 2010 Office 2010 64bit
Novice
Unable to retain Bulleted lists when pasted from RTF to word 2010
 
Join Date: Sep 2012
Posts: 21
ramsgarla is on a distinguished road
Default

pWrdDoc.Sections.Last.Range.PasteAndFormat(Word.WdRecoveryType.wdFormatOriginalFormatting)

That's the code i am using to paste content from RTF to Word 2010,
where pWrdDoc is a instance of Word document.
Reply With Quote
  #4  
Old 10-15-2012, 04:57 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Unable to retain Bulleted lists when pasted from RTF to word 2010 Windows 7 64bit Unable to retain Bulleted lists when pasted from RTF to word 2010 Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 4,000
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

Have you tested the PasteSpecial method instead?
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #5  
Old 10-15-2012, 10:39 PM
ramsgarla ramsgarla is offline Unable to retain Bulleted lists when pasted from RTF to word 2010 Windows 7 64bit Unable to retain Bulleted lists when pasted from RTF to word 2010 Office 2010 64bit
Novice
Unable to retain Bulleted lists when pasted from RTF to word 2010
 
Join Date: Sep 2012
Posts: 21
ramsgarla is on a distinguished road
Default

I tested by using the below mentioned Pastespecial method, but it
didn't work as expected. I can see still find bulleted lists missing in word.

pWrdDoc.Sections.Last.Range.PasteSpecial(, , , , WdPasteDataType.wdPasteRTF, , )
Reply With Quote
  #6  
Old 10-15-2012, 10:57 PM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Unable to retain Bulleted lists when pasted from RTF to word 2010 Windows 7 64bit Unable to retain Bulleted lists when pasted from RTF to word 2010 Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 4,000
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

Which application is opening the RTF document? Maybe it doesn't support number formatting.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #7  
Old 10-16-2012, 09:27 PM
ramsgarla ramsgarla is offline Unable to retain Bulleted lists when pasted from RTF to word 2010 Windows 7 64bit Unable to retain Bulleted lists when pasted from RTF to word 2010 Office 2010 64bit
Novice
Unable to retain Bulleted lists when pasted from RTF to word 2010
 
Join Date: Sep 2012
Posts: 21
ramsgarla is on a distinguished road
Default

I don't think that the application has an issue in supporting Number formatting.I tried using this code and it pastes bulleted lists from RTF to word as expected, but page numbering is messed up.pWrdDoc.Sections.Last.Range.Paste()If i use pWrdDoc.Sections.Last.Range.PasteAndFormat(Word.Wd RecoveryType.wdFormatOrginalFormatting) , Pagenumbering issues are fixed but Bulledted lists is not pasted properly, it's seen as simple text.I am struck with this issue.
Reply With Quote
  #8  
Old 10-17-2012, 01:45 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Unable to retain Bulleted lists when pasted from RTF to word 2010 Windows 7 64bit Unable to retain Bulleted lists when pasted from RTF to word 2010 Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 4,000
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

Which application is it?

I see no problem copying from an RTF file to a Word document, if both documents are opened in word.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #9  
Old 10-25-2012, 03:44 AM
ramsgarla ramsgarla is offline Unable to retain Bulleted lists when pasted from RTF to word 2010 Windows 7 64bit Unable to retain Bulleted lists when pasted from RTF to word 2010 Office 2010 64bit
Novice
Unable to retain Bulleted lists when pasted from RTF to word 2010
 
Join Date: Sep 2012
Posts: 21
ramsgarla is on a distinguished road
Default

I tried this code and i am able to see bulleted lists after pasting the content onto word.

PwrdPasteDoc.Sections.Last.Range.PasteSpecial(, , , , DataType:=Word.WdPasteDataType.wdPasteRTF)

With PwrdPasteDoc.Styles("Normal").Font
.Name = "Arial"
.Size = 10
End With

But, I can find extra spacing between the lines after pasting the data.

How do you avoid extra spacing between the lines ?

Any code snippet would be great.
Reply With Quote
  #10  
Old 10-25-2012, 05:20 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Unable to retain Bulleted lists when pasted from RTF to word 2010 Windows 7 64bit Unable to retain Bulleted lists when pasted from RTF to word 2010 Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 4,000
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

It seems as if you have to change the Line Spacing and Spacing Before/After for the style. Something like this:

Code:
With PwrdPasteDoc.Styles("Normal")
.Font.Size = 10
.Font.Name = "Arial"
.ParagraphFormat.LineSpacingRule = 0  'single line spacing
.ParagraphFormat.SpaceBefore = 0
.ParagraphFormat.SpaceAfter = 0
End With
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #11  
Old 10-26-2012, 04:45 AM
ramsgarla ramsgarla is offline Unable to retain Bulleted lists when pasted from RTF to word 2010 Windows 7 64bit Unable to retain Bulleted lists when pasted from RTF to word 2010 Office 2010 64bit
Novice
Unable to retain Bulleted lists when pasted from RTF to word 2010
 
Join Date: Sep 2012
Posts: 21
ramsgarla is on a distinguished road
Default

I have implemented the code suggested by you, but it doesn't resolve the spacing issue.

Actually, i can find unwanted spacing between each bullet inside the bulleted lists when pasted to word.

i have attached the screenshot for your reference.

How can i avoid these unwanted spaces between bullets in bulleted lists.

Any code snippets would be of great help.
Attached Images
File Type: jpg SampleData.JPG (23.2 KB, 10 views)
Reply With Quote
  #12  
Old 10-26-2012, 05:01 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Unable to retain Bulleted lists when pasted from RTF to word 2010 Windows 7 64bit Unable to retain Bulleted lists when pasted from RTF to word 2010 Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 4,000
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

The "spacing" could be blank paragraphs. Display nonprinting marks by clicking the ¶ button on the Home tab. If you see paragraph marks (¶) between the bulleted items, then you have blank paragraphs, which you should delete.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #13  
Old 10-29-2012, 02:47 AM
ramsgarla ramsgarla is offline Unable to retain Bulleted lists when pasted from RTF to word 2010 Windows 7 64bit Unable to retain Bulleted lists when pasted from RTF to word 2010 Office 2010 64bit
Novice
Unable to retain Bulleted lists when pasted from RTF to word 2010
 
Join Date: Sep 2012
Posts: 21
ramsgarla is on a distinguished road
Default

I included additional conditions to supress the blank spaces between bullets.

.SpaceBeforeAuto =False
.SpaceAfterAuto=False

And it is working perfect now.

Thanks for your suggestions and technical assistance.
Reply With Quote
  #14  
Old 10-29-2012, 04:16 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Unable to retain Bulleted lists when pasted from RTF to word 2010 Windows 7 64bit Unable to retain Bulleted lists when pasted from RTF to word 2010 Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 4,000
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

I'm glad you got it sorted!

I tend to forget about those "auto spacing" options (obviously). :-)
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
WDFormatOriginalFormatting does not retain formatting when content pasted from RTF ramsgarla Word Tables 1 10-05-2012 02:35 AM
Unable to retain Bulleted lists when pasted from RTF to word 2010 Unable to retain section page numbering while removing the blank pages in MS word 201 ramsgarla Word 3 10-01-2012 03:52 AM
Bulleted Lists in Notebook Layout beatles1291 Word 0 01-25-2012 08:52 PM
Bulleted and Numbered Lists peret944 Word 0 03-25-2011 01:08 PM
Unable to retain Bulleted lists when pasted from RTF to word 2010 Bulleted Lists - Changing Font mhartman09 Word 2 12-10-2010 12:18 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:10 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft