Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-07-2016, 10:21 PM
PRA007's Avatar
PRA007 PRA007 is offline How to put HTML in word clipboard for pasting it as formatted Text Windows 7 64bit How to put HTML in word clipboard for pasting it as formatted Text Office 2010 32bit
Competent Performer
How to put HTML in word clipboard for pasting it as formatted Text
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default

Yes sir. It give plain html if copy paste the web extract. Web extract is in HTML formate like



My StrTxt contains

Code:
<DIV class=someclass>
<DIV id=class-00001 class=class num="00001">
so many such lines with <src = embedded image>
<DIV></DIV>
I want to convert this to

Code:
so many such lines with (inline embedded image).
from web I got little bit of solution.

Code:
Set IE = CreateObject("InternetExplorer.Application")
With IE
	.Visible = False
    .navigate "about:blank"
    .Document.body.innerHTML = StrTxt
    .Document.execCommand "SelectAll"
    .Document.execCommand "Copy"
    .Quit
    .Quit 'to make sure.
End With
Set IE = Nothing
    Set Rng = Tbl.Cell(i, 5).Range
        Rng.Collapse wdCollapseStart
        Rng.PasteAndFormat wdPasteDefault
	Set Rng = Nothing
Reply With Quote
Reply

Tags
vba, wordvba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a oval shape in word and pasting image into it from clipboard choper Word VBA 5 06-15-2015 01:04 AM
How to put HTML in word clipboard for pasting it as formatted Text Shift key is pasting from clipboard...WHY? nc1105 Word 2 01-02-2014 11:57 PM
Pasting image captured with a java program 'on to clipboard' into MSWord 2007 is blur tarunkumarreddy Word 0 02-03-2012 09:42 PM
Import formatted text from Word into PowerPoint parboy PowerPoint 0 07-06-2011 08:52 AM
How to make page footers in html formatted .doc file? equalizer700 Word 0 01-27-2011 02:30 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:28 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