So the reporting ability of Access is woefully limited, which means I'm going to need to write my reports to build out in Word. That's all well and good. I've been trying to apply Styles - because they have a role in Word's conversion to PDF. I can apply styles to an entire Paragraph, but not a Selection. It's weird, because the font changes apply but the selection itself is not set as being in that Style.
Here's the code I'm using. It creates the text and applies the style. Before this there's a function that defines the style, opens a new word document, and then this runs
Code:
Dim varword As String
Dim myRange As Word.range
varword = "One New Customer"
wordDoc.range.text = vbTab & "Customer:" & vbTab & varword & vbTab & "Incident Notifications:" & vbTab & "notifications@onenewcust.com" & vbNewLine _
& vbTab & "Tier:" & vbTab & "Platinum" _
& vbTab & "Customer Surveys:" & vbTab & "surveys@onenewcust.com" & vbNewLine _
& vbTab & "Status:" & vbTab & "On-Boarding" _
& vbTab & "Performance Summaries:" & vbTab & "perfsum@onenewcust.com" & vbNewLine
wordDoc.Paragraphs(4).range.InlineShapes.AddHorizontalLineStandard
Set myRange = wordDoc.range(11, 11 + Len(varword))
myRange.Select
edit: I'm tired and losing my mind...
THIS works but applies the style to the entire row:
myRange.Style = wordDoc.Styles("Heading 1")
however this does not, but does apply the font changes to the selection
wordApp.Selection. = wordDoc.Styles("Heading 1")
basically, applying the style to Range sets the entire Paragraph to the style, but applying it to the Selection just does font changes without actually applying a style.