[AccessD] OLE Word Doc Range/position

Mark A Matte markamatte at hotmail.com
Wed Apr 16 08:29:41 CDT 2008


Hello All,

I am still working with OLE MSWord Object on an access form. I am trying to change the font/color/highlight of the text...the problem I am having is finding the position to start my formatting.  I am using something like:

Set rngTemp = ActiveDocument.Range(Start:=CharCount, End:=Len(Me!Memo1))

...to select the renge.  What I have found is that LEN counts everything, but when selecting the range above...you have to omit carriage returns...and a few other things(still looking for these).

For example...I copy from a memo field(contains 2 carriage return) to the OLE Word Doc...Len(memo)=180 but the last position available is 178?

Any thoughts?

Thanks,

Mark A. Matte


> From: markamatte at hotmail.com
> To: accessd at databaseadvisors.com
> Date: Fri, 11 Apr 2008 20:04:05 +0000
> Subject: [AccessD] OLE Word Doc Font
>
>
> Hello All,
>
> I am working with OLE MSWord Object on an access form. I'm trying to play with the font...'highlighting' specifically. I can change the size,color,bold...and stuff but looking for highlighting.
>
> There does not seem to be intellisense for these properties on my maching.
>
> Any thoughts?
>
> Thanks,
>
> Mark A. Matte
>
> Here is the type of code I'm using:
>
> *******************
> oDocument.Content.Select
> With oDocument.Application.Selection
>
> ' Add a heading at the top of the document...
> .Style = oDocument.Styles("Heading 1")
> .Font.Color = &HFF0000
> .TypeText T1
> .ParagraphFormat.Alignment = 1 '[wdAlignParagraphCenter]
> .TypeParagraph
> .TypeParagraph
> .Font.Bold = True
> .TypeText T2
>
> End With
> Set oDocument = Nothing
> ********************
>
>
> _________________________________________________________________
> Pack up or back up–use SkyDrive to transfer files or keep extra copies. Learn how.
> hthttp://www.windowslive.com/skydrive/overview.html?ocid=TXT_TAGLM_WL_Refresh_skydrive_packup_042008
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com

_________________________________________________________________
Pack up or back up–use SkyDrive to transfer files or keep extra copies. Learn how.
http://www.windowslive.com/skydrive/overview.html?ocid=TXT_TAGLM_WL_Refresh_skydrive_packup_042008



More information about the AccessD mailing list