Word DOC files - submission formatting

gunhilltrain

Multi-unit control
Joined
Mar 1, 2018
Posts
7,461
If I understand this correctly, I can use the field to submit a Word document with italic and bold formatting and then - someone on the site adds HTML codes?
 
Yes you can submit a MSWord .DOC file, but a clean RTF file would probably work better. (by "clean" I mean with tracked changes and comments removed.)
 
Thank you.

Most of the formatting I use would be italics or sometimes indents for a block-quote appearance - not an actual block-quote style which I think is available in Word.
 
You can add those html tags yourself.

<i> text </i> - italic
<b> text </b> - bold
<blockquote> text </blockquote>

The only problem with them it that if the text happens at a page break then the part on the new page won't be formatted.
 
Thanks.

How about other ways of indenting text - tabs for example? Will those be included?
 
Yes, I seem to remember that from a couple of HTML/CSS courses I took a few years ago (although I never used it on a job).

There is a field ("notes") in the submission form that allows instructions about the document, i.e., "You may include any special instructions in the Notes field. These comments will not be shown on the site, they will only be read by the webmaster before posting the submission on the site."

By the way I did send a question directly to the site. They must be pretty busy because they haven't answered yet (a week or so).
 
Well if you emailed it, you will never get an answer.

If you PM'ed Laurel, she may answer unless it's something that are answered in the FAQ or Submission info.
 
Yes, I imagine managing this site must be a challenge.

This answers some of these questions:

https://www.literotica.com/s/bold-or-italic

It took me a while to find it; I had to go outside the site and use Google to search. There is also a nice section that describes vB code which works on message boards where HTML is disabled.
 
You can conjurer up a Word Macro to help you.

I assume you can record a word macro; it's not too hard and there's lots of help. If you know how to edit macros, the skip to the bottom of this post for the code.

The key feature here is the special character sequence "^&", which means "everything matched".

1. Select all text (ctrl-a) before you start recording. This limits the macro to whatever is the selection each time it is run.
2. Start recording a macro. I called mine BI2HTLM. You might want to assign it to a keyboard short cut for easy use.
3. Open Find-Replace dialog (Ctrl-H).
  • Park the cursor in the find what box and clear it out. Click "formatting" button, and select "font". Select "bold" for Font style then "close".
  • Enter "<B>^&</B>" in the Replace with box. Click "formatting" button, and select "font". Select "bold" for Font style then "close".
  • Click Replace All. If you are prompted to search the remainder of the document, say no.
4. Update the Find-Replace find what box to select italic font. Substitute <I>^&</I> in the replace with box. Change the replacement font to italic. Finally, Replace All again.
5. Update the Find-Replace find what box to select bold italic font. Substitute <B><I>^&</I></B> in the replace with box. Change the replacement font to bold italic. Finally, Replace All again.
6. Close the Find-Replace dialog and Stop recording the macro.

Note that the location of the cursor in the Find-Replace dialog determines where the Format button will put the formatting you select.

Clearing all text from the Find what box will look for any contiguous text which matches the formatting you select.


The following MS WORD macro may be of help for Word 2003 and later. It also inserts <p> at the front of paragraphs and replaces newlines with "<br> <br>" to try and get the HTML formatter to act right.

If you're experienced enough with macros to add and edit it, then please let me know if I missed something! ;)
Code:
Sub BI2HTML()
'
' BI2HTML Macro
' Macro recorded 3/13/2018 by Owner
'
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "^l"
        .Replacement.Text = "<br><br>"
        .Forward = True
        .Wrap = wdFindStop
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
    With Selection.Find
        .Text = "^p"
        .Replacement.Text = "<p>"
        .Forward = True
        .Wrap = wdFindStop
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
    Selection.Find.ClearFormatting
    Selection.Find.Font.Bold = True
    Selection.Find.Font.Italic = True
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Font.Bold = True
    Selection.Find.Replacement.Font.Italic = True
    With Selection.Find
        .Text = ""
        .Replacement.Text = "<B><I>^&</I></B>"
        .Forward = True
        .Wrap = wdFindStop
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
    Selection.Find.ClearFormatting
    Selection.Find.Font.Bold = True
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Font.Bold = True
    With Selection.Find
        .Text = ""
        .Replacement.Text = "<B>^&</B>"
        .Forward = True
        .Wrap = wdFindStop
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
    Selection.Find.ClearFormatting
    Selection.Find.Font.Italic = True
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Font.Italic = True
    With Selection.Find
        .Text = ""
        .Replacement.Text = "<I>^&</I>"
        .Forward = True
        .Wrap = wdFindStop
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub
 
Last edited:
The macro recorder in older versions of Word has problems.

In particular, they don't record the from/to font information, and they default to trying to processing the whole darn document.

The easiest way to handle thing may be this:
  1. Open Notepad, cut the macro from the previous post, and paste it into Notepad.
  2. In Word, start the macro recorder, call your macro BI2HTML, and then do something, anything we don't care what, then stop the recorder.
  3. Open the Visual Basic Editor. Try Menu/Tools/Macros/Visual Basic Editor. You version of Word may be different, look for Edit Macro, or Visual Basic.
  4. Locate the BU2HTML macro in the editor. Select everything between the lines, starting Sub BI2HTML() through End Sub.
  5. Swap over to Notepad and select all of the saved macro
  6. Swap back to the Visual Basic Editor and PASTE the Notepad version over what you recorded.
  7. Close the Editor and return to Word.
 
Last edited:
Not sure what version of word that I have. I just copy and paste to submit and it worked fine.
 
I have word 2003 and I just copy and paste to submit. I also type the html tags I need as I go. No big deal. Unless you are composing on a phone. :eek:
 
Back
Top