473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Creating word documents

I am trying to change the linewidth of a page border, and keeping getting an
error at the "wdLineWith075pt" For some reason, it only accepts the value
of 24 like the left border. Yet when I print the document that has been
created, the right border does not print, so I've been trying to put in
different values and I get an error on all values I've tried other than 24.
Does anyone have an idea of what I'm doing wrong?

Dim Word As Object
Dim rtf As ActiveReportsRTFExport.ARExportRTF
Set Word = CreateObject("word.Application")
Set rtf = New ActiveReportsRTFExport.ARExportRTF
rtf.FileName = "c:\temp.RTF"
rep.Run False
rtf.Export rep.Pages
Word.Documents.Open rtf.FileName

With Word.Documents(1).Sections(1)
'left border
.Borders(wdBorderLeft).LineStyle = 9
.Borders(wdBorderLeft).LineWidth = 24
.Borders(wdBorderLeft).ColorIndex = 0

'right border
.Borders(wdBorderRight).LineStyle = 9
.Borders(wdBorderRight).LineWidth = wdLineWidth075pt
.Borders(wdBorderRight).ColorIndex = 0

'top border
.Borders(wdBorderTop).LineStyle = 9
.Borders(wdBorderTop).LineWidth = 24
.Borders(wdBorderTop).ColorIndex = 0

'bottom border
.Borders(wdBorderBottom).LineStyle = 9
.Borders(wdBorderBottom).LineWidth = 24
.Borders(wdBorderBottom).ColorIndex = 0

'all borders
.Borders.DistanceFrom = 1
.Borders.AlwaysInFront = True
.Borders.SurroundHeader = True
.Borders.SurroundFooter = True
.Borders.JoinBorders = False
.Borders.ApplyPageBordersToAllSections

End With
Word.Visible = True
UserControl.MousePointer = vbDefault
Set Word = Nothing
Set rtf = Nothing
Set rep = Nothing
End Sub
Thanks for your help.
Aug 10 '06 #1
0 1478

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: campwes | last post by:
Hey, all. I'm trying to develop a C# app that creates Word 2003 mail merge documents with an Oracle 9i database as the datasource. I used the following as an example of how I can start out: ...
3
by: m3ckon | last post by:
Hi there, I can succesfully create a word doc from my asp.net page, but I have 2 issues I need to resolve in order to use it in my app: 1) Creating a table: I seem unable to create a table,...
2
by: elziko | last post by:
I'm trying to create a new table in word from a DataTable (sourceTable): objDoc.tables.Add(Range:=objDoc.Range, NumRows:=sourceTable.Rows.Count, NumColumns:=sourceTable.Columns.Count,...
6
by: Keith Butler | last post by:
H Very new to CHM file. My question is can I create CHM file from a word document (or any other document)? Appreciate links to any good article on creation of CH Thank Keit
2
by: tamaker | last post by:
I have a registration form where a user is able to, upon submission of the form, have their submission entered into a simple database... now Im looking to create a word document on the fly from...
3
by: Brian Cryer | last post by:
A project I'm about to start on has a requirement to create word documents on the fly for download from the website. To date all the code examples I've found on the net use automation (and by...
0
by: PracticalApps | last post by:
I looked to find a canned solution to create a Word document in my application and just couldn't find anything that just gets to the point. I would think, and I may be making too strong of an...
2
by: uamusa | last post by:
I am Dynamically generating a proposal(report) in MS Word. By default the Paragraph Alignment is "Left". For the First 6 Paragraphs I set the Alignment to "Center", and then when attempting to...
2
micmast
by: micmast | last post by:
Hey everybody, After looking on the internet, I found that a way to create word documents is using the win32com object. The easy part is winapp = win32com.client.Dispatch("Word.Application")...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.