Opening an HTML page in Word

Microsoft OFFICE

    Sponsored Links

    Next

  • 1. Version Compatibility
    Our business has Office 2000 deployed across the enterprise and I do all the development involving Office products. Recently, due to dependencies in a new application, some users required Office XP. Now these users are asking me to do development for them for Office XP. Since XP came out quite a while ago and we didn't upgrade then, I've lost any information I've ever had on what, if any, limitations there might be between VBA in Office 2K and XP. What I need to know is if the code I write in VBA for Office 2K will need to be massaged once it enters the XP environment or if it will run as written? (Or, in other words, do I need to get XP installed on my machine and write the code in it for those using Office XP?) Thank you for any information you can provide. Trisha
  • 2. how do I access a userform through a macro?
    I've created a little userform in VBA Word 2002 called Userform1. But I can't figure out how to access it through a macro. When I go to tools/macro/macros it doesn't recognize the userform1 as a macro (I guess because it isn't a macro?). So how do I create something in Word to pop up the userform1 for use? thanks Matthew XXXX@XXXXX.COM
  • 3. VBA compatibility EXCEL 2000 - EXCEL XP
    Hello, colleagues and experts, We developed some VBA projects under EXCEL 2000. Some of them have to be transported to EXCEL XP. If the projects are somehow elaborated, compatibility problems seem to be regular. In some cases, we were able to solve the issues: For instance, user forms containing pictures developed under 2k lead to an exception in xp. Unfortunately, I have no access to a list of exception information given in the system dump. Does anybody have experience with similar problems and an idea what particular features could cause the exception? The "normal" information given by EXCEL just states that it crashed, but not where, when, and (most important) why. Thanks, Josef ------------------------- Josef Georg Brecht XXXX@XXXXX.COM -------------------------
  • 4. Migrating user-defined toolbars
    Hi, Does anyone know if it is possible to migrate user-defined commandbars with their associated macro code in one swoop to another machine. I have a new computer here and would like to export just the stuff I use regularly. That is, my commandbars in Outlook, Word and Access. Best Regards, Gordon Filby Karlsruhe
  • 5. keep object reference
    If I create an object and assign it a reference, can I keep that reference throughout the module? Thanks Aidy

Opening an HTML page in Word

Postby cooperjv » Tue, 13 Apr 2004 03:49:58 GMT

I have an application that opening HTML documents and saves them as
word documents. This works fine but I am having a problem with opening
a Html page that is about 1716 KB in size and has a huge table.

I am also unable to open this document in word directly from the
drive. If I right click the html file and choose OpenWith -> Microsoft
word, MS Word comes up and Opening appears in the status bar and then
I get this message
"The document name or path is not valid
Try these suggestions
*Check the file permissions for the document or drive
*Use the file open dialog box to locate the document."

If I use the file open dialog box in MS Word then the documents opens
in Frontpage. (I have Word 2002).

This document will open in IE but will not open in MS Word.

Any help will be appreciated.

Joseph Cooper

Similar Threads:

1.Opening an HTML page in Word

I have an application that opening HTML documents and saves them as
word documents. This works fine but I am having a problem with opening
a Html page that is about 1716 KB in size and has a huge table.

I am also unable to open this document in word directly from the
drive. If I right click the html file and choose OpenWith -> Microsoft
word, MS Word comes up and Opening appears in the status bar and then
I get this message
"The document name or path is not valid
Try these suggestions
*Check the file permissions for the document or drive
*Use the file open dialog box to locate the document."

If I use the file open dialog box in MS Word then the documents opens
in Frontpage. (I have Word 2002).

This document will open in IE but will not open in MS Word.

Any help will be appreciated.

Joseph Cooper

2.How to on word doc output (page setup, streaming html and datagrid, open file)

I'm adding this as it to me a while to figure out all the pieces to be
able to do this without using Microsoft.Office.Interop which caused me
problems on the web-server.

Streaming is the easy part, but I couldn't initially work out how to
manipulate the page setup to change page margins and orientation,
that's why I was looking at Microsoft.Office.Interop.

But with Microsoft.Office.Interop I couldn't fiure out how to stream
HTML Source to the word doc it would only output text.

So here's what I figured out:

1. Open a new word doc and alter the page setup to how you want it to
look. Then in the body of the document type the following:
#INSERTDATAHERE#

If you read the html source of this you should easily be able to pick
out the page setup section:

@page Section1
	{size:11.0in 8.5in;
	mso-page-orientation:landscape;
	margin:.5in 1.0in .5in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}

2. Then save that word doc as html in your web application folder

3. create a blank word doc in your web application folder called
output.doc

4. In your asp.net page add an asp button and an onclick event
    e.g:
<asp:Button id="CmdExport" onclick="Export_Click" Text="Click to
Export"></asp:Button>

In the codebehind for the onclick event = Export_Click this example
will render a datagrid and some html (example is in VB)

Sub Export_Click(Sender As Object, E As EventArgs)

         Dim sw As New System.IO.StringWriter()
         Dim hw As New System.Web.UI.HtmlTextWriter(sw)

        'Get the HTML for the control.
         hw.Write(("<center><H2>THIS IS MY TITLE</H2>"))
         hw.Write(("<p>This is a subtitle</p>"))
         datagrid.RenderControl(hw)
         hw.Write(("</center>"))

          'This section will read the input and look for
          '#INSERTDATAHERE#" and then input your data in its place
          ' and will then save the output and open it on as a new
          'file on the client
            Dim input As New
StreamReader(Server.MapPath("newdoc.html"))
            Dim output As New
StreamWriter(Server.MapPath("output.doc"))

            Dim findstring As String = "#INSERTDATAHERE#"
            Dim line As String = input.ReadLine()
            Dim pos As Integer


            Do Until line Is Nothing
                If InStr(1,line,findstring,1) > 0 Then

output.WriteLine(Replace(line,findstring,sw.ToString()))
                Else
                    output.WriteLine(line)
                End If

                line = input.ReadLine()
            Loop

            output.Close()
            input.Close()

         End If
         ' this section will get output and open the file as an
         ' attachment on the client
        Dim FilePath As String = Server.MapPath("output.doc")
        Dim fs As New
FileStream(FilePath,FileMode.Open,FileAccess.Read)
        Dim bw As New System.IO.BinaryReader(fs)
        Dim byt() As Byte, i As Integer
        byt = bw.ReadBytes(CInt(fs.Length))
        i = byt.Length()
        Response.ContentType = "application/msword"
        ' change attachment to inline if you want it to open
        'in browser window
        Response.AddHeader
("content-disposition","attachment;filename=myoutput.doc")
        Response.OutputStream.Write(byt, 0, i)
        Response.OutputStream.Close()

End Sub

hope this helps someone and saves you some time. Someone else may have
other suggestions and better code, but this is my 2cents.

3.Re-opening FP HTML edited and resaved as HTML in Word

Hi all. First-time poster (clap clap clap)...
How can I open HTML pages in FrontPage that have been edited in Word and 
then resaved as HTML back in the FP Web? 

I ensured that the HTML file associations are set to FrontPage and selected 
the default in the Choose Program context menu, but still, whenever I try to 
open the edited files, they always open in Word. 

More details: I manage a FrontPage Web and need SMEs to validate the docs. 
Can someone suggest a better way of managing this without needing to install 
FrontPage on several other machines?

Thanks!

4.Open a word document in HTML Page without allowing edit the user

Hi all,

I need a solution to open a word document in a html page. At the same time the opened document should not be modified by the user. And one more thing, is there any way to get the word content in an interactive manner. That is paragraphs should be in a particular order and title should be bold with some special fonts.. like that. And tell me whether the user machine should have the word or not??

Pls. reply soon.. Thank you in advance.

5.Page numbers & opening HTML .doc In Word

I have quite same problem as Kurt had it in year 2003. I did not find a
solution...

Kurt wrote.

I am hosting the Word formatting files (filelist.xml and header.htm)
on my server, so that when a user opens an HTML file in Microsoft Word
the document will have page numbers.  (The filelist.xml and header.htm
files are the files that are created locally when you use the File ->
Save as Web Page option and have page numbering turned on.)  Although
the page numbering is preserved when the users open the html page in
Word, they are receiving the following message,


"Some of the files in this Web page aren't in the expected location.
Do you want to download them anyway? ".


I believe that the following requirements must be met to avoid this
message.


1. The filelist.xml & header.htm must exist on the local machine.
2. The filelist.xml & header.htm must be in a directory with the same
name as the Word document being opened with '_files' appended. (Ex.
Filename: test.html = test_files)
Or...
The name of the Word document being opened must be prepended with an
underscore to filelist.xml and header.htm.  (Ex. Filename:  test.html
= test_filelist.xml & test_header.htm)


Is there any way of preserving page numbering in an html document when
opening in Word, without receiving this error message?  I've tried to
embed the content of the filelist.xml and header.htm in the HTML
document, but it didn't work.  Is there another alternative to
maintaining page numbering when an HTML document is opened in Word.


Thanks for any help.

6. Page numbers & opening HTML doc. In Word

7. saving a web page that is html and then opening it in word

8. I have created a html page in Dreamweaver which I then open using



Return to Microsoft OFFICE

 

Who is online

Users browsing this forum: No registered users and 68 guest