Conditional text based on document type

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to have different pieces of text included in a document based on
the document type.

For example, if the document is being save as an HTML filetype, I want to
include hyperlinks back to earlier headings in the document. But if it is
being saved as a DOC filetype (because it will be a printed manual) I don't
want these hyperlinks to appear.

It sounds like some variation of the IF statement might do this if I knew
what to check for to determine the filetype as the document was being saved.

Thanks
 
Cross-references inserted as hyperlinks do not have Hyperlink formatting
(blue and underlined) in .doc files. Unfortunately, it would appear that
they don't in .htm files, either, even when viewed in Web Page Preview.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Suzanne S. Barnhill said:
Cross-references inserted as hyperlinks do not have Hyperlink formatting
(blue and underlined) in .doc files. Unfortunately, it would appear that
they don't in .htm files, either, even when viewed in Web Page Preview.

Thanks for response, Suzanne.

I'll have to experiment some more, I guess. I had tried inserting using the
hyperlink choice, not the cross-reference as hyperlink one. There, the link
displayed in both the DOC and HTM output, but only working in the HTM one.

If there were some way to have this link not appear in the DOC output, this
would be what I am looking for. Since it doesn't do anything there, there's
no reason to show it.

If it had a page number, there might be some use to it, and it woudln't be
as bad, although it does tend t clutter up a printed copy of the document.

Thanks again,
Joe
 
Your best bet, if you don't want the hyperlinks to display in the document
at all is to modify the Hyperlink character style in the .doc file to be
Hidden. Or, if there is text to be displayed but you just don't want the
hyperlink formatting, then modify the Hyperlink to be Default Paragraph Font
+ (removing the Font Color: Blue and Underline properties).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Thanks for followup Suzanne,

I may be just tilting at windmills so to speak, ;-)

I was hoping for something that would be automatically be determined by the
filetype when saving the file; i.e., DOC or HTM.

As I thought about it originally, I thought maybe there was a condition of
some sort that could be tested by an IF statement (that would return the
filetype) and that this could be used to exsclude the hyperlinks when saving
to DOC for printing.

But then as I thought soe more about it, and did some more experimenting, I
noticed that indexes will be a problem.

Word automatically removes the page numbers from TOC entries and makes them
hyperlinks when saving to HTM. This works great. However, it doesn't do
the same with index entries. They retain their page numbers even though page
numbers don't exist in the resulting HTML document.

Thanks again,
Joe
 

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

Back
Top