Embedding a web page in a document

J

Jerry Krinock

Does anyone know if there is a way to embed a web page in a document,
similar to the way you can embed other Word documents, Excel sheets,
etc. as icons? I have a web page, that is, a file of html, created by
another application. I would like to see a hyperlink or icon in my
document to this web page, but instead of linking to an external file,
it would link to something embedded in the Word document. The idea is
that I want my document to be all self-contained in this one .doc
file. I cannot find a way to do this.

I'm using Word v.x fof Mac but would happily upgrade to Word 2004 for
Mac to get this capability!
 
J

Jim Gordon MVP

Hi Jeff,

Word can treat your document as a web page. Simply use File>Save As Web
page. After you've saved the document you now have an HTML document. You can
open your other html document in Word by using File>Open. Copy and paste
just like always. Insert Bookmarks and Word will put HTML style bookmarks
into the document. Save it again and you've got an HTML document.

This will work with HTML that is fairly simple and straightforward. If you
have something complex you may need to use a more sophisticated HTML editor
such as Macromedia DreamWeaver, Adobe GoLive (there are several others to
choose from as well).

-Jim

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 
J

Jerry Krinock

Jim,

I understand that if I save the document as an html, then I can do all
kinds of fancy things. But we have this policy/procedure where I work
that the final product has to be a Word document. (It's 1990
thinking, but I cannot change it at this time).

It seems that the only "objects" I can insert are Microsoft documents,
specifically:

Microsoft Equation
Microsoft Excel Chart
Microsoft Excel Worksheet
Microsoft Graph Chart
Microsoft Org Chart
Microsoft Word Document
Microsoft Word Picture

If I choose any other file type, it simply ignores my command (no
error message!)

I understand how to convert a Word document to html using "Save As Web
Page". As a workaround for only being able to insert these file
types, I see that I could get what I want if I could do the REVERSE;
i.e. convert a web page (created with another application) to a Word
document. Then, I could Insert it as an Object.

Does anyone know a way to convert a file of html to a Word document.
It would not have to preserve formatting exactly.

Jerry
 
J

Jerry Krinock

From another angle, I have noticed that it is possible to embed a web
page if I go to the Dark Side, that is, if I use Word 2000 for
Windows. In Winword, Insert > Object allows me to insert whatever
kind of file I want to, and if I insert a html file as an icon, I get
an Internet Explorer icon which launches IE and shows the embedded
html when the reader doubleclicks on it. All exactly as desired.

So I need a Windows feature which is not implemented in Office for
Mac.

P.S. But I'm not quite there, even on the Dark Side. The remaining
problem is that if the web page has links to images in a local folder,
of course these images do not show because the image files have not
been embedded in my document. I haven't found any way to embed the
folder of image files so that the embedded html can find it.

But at least I can get something. Does anyone know if this Windows
feature has been implemented in Office 2004 for Mac, so we don't have
to go to the Dark Side?
 
J

Jerry Krinock

From another angle, I have noticed that it is possible to embed a web
page if I go to the Dark Side, that is, if I use Word 2000 for
Windows. In Winword, Insert > Object allows me to insert whatever
kind of file I want to, and if I insert a html file as an icon, I get
an Internet Explorer icon which launches IE and shows the embedded
html when the reader doubleclicks on it. All exactly as desired.

So I need a Windows feature which is not implemented in Office for
Mac.

P.S. But I'm not quite there, even on the Dark Side. The remaining
problem is that if the web page has links to images in a local folder,
of course these images do not show because the image files have not
been embedded in my document. I haven't found any way to embed the
folder of image files so that the embedded html can find it.

But at least I can get something. Does anyone know if this Windows
feature has been implemented in Office 2004 for Mac, so we don't have
to go to the Dark Side?
 
J

Jim Gordon MVP

Hi Jerry,

See below...

Jim,

I understand that if I save the document as an html, then I can do all
kinds of fancy things. But we have this policy/procedure where I work
that the final product has to be a Word document. (It's 1990
thinking, but I cannot change it at this time).

The trick here is to know that once you have the document just the way you
want it in HTML you can Save-As and choose Microsoft Word as the file
format. Then the same item is a Word document with a .doc extension.
It seems that the only "objects" I can insert are Microsoft documents,
specifically:

Microsoft Equation
Microsoft Excel Chart
Microsoft Excel Worksheet
Microsoft Graph Chart
Microsoft Org Chart
Microsoft Word Document
Microsoft Word Picture

If I choose any other file type, it simply ignores my command (no
error message!)

That is correct. Mac Office supports OLE version 1. Windows office supports
OLE version 2 and that's what lets them embed so many different kinds of
files. The idea is that when you double-click the object that it opens the
source application. It works with the programs you listed, but not with
others. I know that the MacBU is curious about the demand for OLE version 2,
so if you would take a moment to send a feature request using the feedback
option on Word's help menu another vote for this feature might spur things
along for inclusion in a future version of Office.
I understand how to convert a Word document to html using "Save As Web
Page". As a workaround for only being able to insert these file
types, I see that I could get what I want if I could do the REVERSE;
i.e. convert a web page (created with another application) to a Word
document. Then, I could Insert it as an Object.

Does anyone know a way to convert a file of html to a Word document.
It would not have to preserve formatting exactly.

Word can only handle fairly simple HTML, but in Word X and earlier use File
Open Web Page to paste in a URL. In Word 2004 turn on the Web toolbar
using View > Toolbars. The first button on the toolbar lets you choose the
URL to open. Any version of Word 2001 and higher can open HTML files using
File > Open (you may have to change the selector to files of type: all
files).

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 
J

John McGhie

Hi Jerry:

Well, yes, you can. It's not really a great way to do things, but you can:

1) Create your document

2) Save it

3) Bookmark the section yu want to link to

4) Insert a hyperlink in the ordinary way, ending "#bookmarkname"

You can do this in Word X, but Word X's HTML abilities are nowhere near what
Word 2004's are. You would be well advised to upgrade anyway: you won't
believe how much better Word 2004 is until you use it.

Hope this helps


Does anyone know if there is a way to embed a web page in a document,
similar to the way you can embed other Word documents, Excel sheets,
etc. as icons? I have a web page, that is, a file of html, created by
another application. I would like to see a hyperlink or icon in my
document to this web page, but instead of linking to an external file,
it would link to something embedded in the Word document. The idea is
that I want my document to be all self-contained in this one .doc
file. I cannot find a way to do this.

I'm using Word v.x fof Mac but would happily upgrade to Word 2004 for
Mac to get this capability!

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Consultant Technical Writer
Sydney, Australia +61 4 1209 1410
 
J

Jim Gordon MVP

Hi Jerry,

I was answering a different question in another newsgroup, but that question
may have something to offer you.

Someone asked about using a VBA macro to embed a web page into Word. As it
turns out this works fine:

Sub Macro1()
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:="INCLUDETEXT ""HardDriveName:FileName.htm""", PreserveFormatting:=True
End Sub

But you can do it without a macro, too. Use Insert>Field>IncludeText then
click the Options button to specify the file path.

-Jim

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 
J

Jerry Krinock

Jim Gordon MVP said:
I know that the MacBU is curious about the demand for OLE version 2,
so if you would take a moment to send a feature request using the feedback...

OK, they just got my vote.
Word can only handle fairly simple HTML, but in Word X and earlier use File

Yes, fairly simple indeed. It seems unable to find images which are
in subfolders (confuses unix /A/B/C and HFS :A:B:C pathnames). But
even if I go to a site where images are not in subfolders, it does not
show them anyhow, so there's no sense in trying to understand that.

I shall try this again when I buy Word 2004. If it will work, then I
can "convert an html page to a Word document", which is one of my
possible solutions. (I can then embed the html-converted-to-.doc using
OLE version 1).

Thanks, Jim.

Jerry Krinock
 
J

Jerry Krinock

Jim Gordon MVP said:
Sub Macro1()
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:="INCLUDETEXT ""HardDriveName:FileName.htm""", PreserveFormatting:=True
End Sub

But you can do it without a macro, too. Use Insert>Field>IncludeText then
click the Options button to specify the file path.
Word reports a syntax error when playing the first line of that macro.
I don't know much VBA, but the second line looks weird too; the
quotes don't look balanced.

HOWEVER, when I use your "without a macro" suggestion, I get the same
issues reading images, images in subfolders, etc. than I got when I
tried to "Open Web Page...", as I explained in a previous reply. So,
don't worry about that macro, at least for me, because it looks like
it will not do what I want until maybe I get Word 2004. I know how to
fix the macro by "recording" the second method if it works.

Thanks again,

Jerry
 
J

Jim Gordon MVP

Hi Jerry,

This feature is the same in Office 2004. I tried a couple different web
pages that were saved on my computer. In one case the pictures loaded fine
even when they were in another folder. In another case one of the pictures
would not load and I saw the slash that you were talking about. It might
have something to do with how the web pages were saved on my computer. I use
a lot of different browsers and "save-as" techniques. I don't know which
method was used in my test cases, but it is worth experimenting with I
think.

Your notion to record the macro is excellent. I probably should have urged
you to do that. I may have messed up a quotation in the process of making
the example generic rather than specific to my own drive. Sorry about that.

In the example that worked, when I control-clicked on the result and chose
"toggle field codes" it showed that there was a Word field code for
Hyperlink as well as the IncludeText field.

Just keep in mind that Word is not a robust HTML editor. Word's HTML primary
claim to fame is that it can accurately restore a document that was saved by
word as HTML and turn it back into a Word document. Beyond that it can get
pretty lame. Switching back and forth between HTML source and other views
can cause Word to simply hang if it can't figure out the HTML.

I hope this helps somehow.

-Jim

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top