Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




CreateNewDocument In Word 2007


When calling CreateNewDocument with the label name of 5160 from vb the word uses the wrong 5160 (It takes the one from Avery with continuous printer).

Does any one have any updated code that will work with any version of word?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
COM Add-in On Word 2007 - Vista
Hey guys,

I am having an issue with COM addins also with Office 2007. Mine is a problem on XP with Office 2007 and Vista with Office 2007. What happens is I have an addin that adds a menu item also. This menu item then has a drop down list of 5 things. When the user clicks the menu item that was added by the addin, Word errors with Word has encountered a problem and needs to close. Any ideas? It works as planned in earlier versions of office. Thanks for any help.

COM Add-in On Word 2007 - Vista
Hello,

I have a COM DLL tool that build a customized toolbar with some options in it. It works great on Word 2000,2002 & 2003. I have tried to install it on Word 2007 that is on Vista and I got the custom toolbar and it works. The problem is I got another toolbar that is called "Menu Commands" (screen shot attached) and in it there are two "General" menus! Those two menus did not appear in any of Word 200-2003. The content of the General menu mimic one of the other customized menus in my toolbar.

The code is about 15K (not well documented) lines (parts of the code is totally not documented)! I am finding it hard to debug because of the events. I have spent two days trying to understand from where is this new "Menu Commands" coming from but until now I have no idea!

Any advice on how to debug it in a better way is welcomed.

Thanks in advance,

- George

AppActivate On Word 2007
Hi All,

I have an AppActivate statement in my VB Code to acivate Microsft Word, it works for all flavours of word and operating system, but it fails on Vista with Word 2007.

here's the line which causes error:

WordBasic.AppActivate "Microsoft Word", 1

Kindly help me in figuring out possible reason behid it's failure.

Thanks

Need Help With Macros In Word 2007
I know almost nothing about Visual Basic, but I need to write a macro in MS Word 2007 that will insert paragraph returns after the text "Cd" , "Hg" , "Pb" , "Cr". Can anyone help? This is what I have so far (I know it isn't pretty and it definitely doesn't work). Any help would be greatly appreciated. Thank you!


Sub Results()
'
' Results Macro
'
'
Do While selection.Find.Execute(FindText:="Cd") = True
selection.InsertParagraphBefore

Loop

End Sub

How To Disable Tab Bar In Word 2007 Using Vb6?
Hello,

My program used to work in all the versions of Microsoft Office upto 2003. But it does not work in Office 2007.

I want to disable Tabs (i.e. Menu bars in old office). and even short cuts like (Ctrl + S), etc.

Can anyone help me on this?

Its very Urgent.

Thanks in advance.

AutoExec Is Not Working In Word 2007
Hi All,

Am working on Office word 2007. I want to call function when the word file is opened as add-in or when the file is double clicked. So I used AutoExec method in a module as this willl be called first when the file is opened. But when double clicked on the .dotm or .docm file netither AutoExec nor AutoOpen are not called.

I tried saving the file in both .dotm and .docm.

So please advice me how I can accomplish this.

VB6, MailMerge, Word 2007, Headaches.
Is the Microsoft Word 12 Object Library uncompatible with earlier versions of the object library? We have a mail merge application that worked on XP/Office 2003 Word fine. It created 5160 Avery labels, however, when I run the exact same code with Office 2007 installed, I get 4 columns of labels instead of 3, and the 4 columns is not Avery 5160 format.

I've duplicated this using code straight from Microsoft:

This code is basically the same thing we do for Office 2000 - 2003.

Here's the code block:

Code:
Private Sub Command1_Click()

Dim oApp As Word.Application
Dim oDoc As Word.Document

'Start a new document in Word
Set oApp = CreateObject("Word.Application")
Set oDoc = oApp.Documents.Add

With oDoc.MailMerge

'Insert the mail merge fields temporarily so that
'you can use the range that contains the merge fields as a layout
'for your labels -- to use this as a layout, you can add it
'as an AutoText entry.
With .Fields
.Add oApp.Selection.Range, "Contact_Name"
oApp.Selection.TypeParagraph
.Add oApp.Selection.Range, "Address"
oApp.Selection.TypeParagraph
.Add oApp.Selection.Range, "City"
oApp.Selection.TypeText " "
.Add oApp.Selection.Range, "Postal_Code"
oApp.Selection.TypeText " -- "
.Add oApp.Selection.Range, "Country"
End With
Dim oAutoText As Word.AutoTextEntry
Set oAutoText = oApp.NormalTemplate.AutoTextEntries.Add("MyLabelLayout", oDoc.Content)
oDoc.Content.Delete 'Merge fields in document no longer needed now
'that the AutoText entry for the label layout
'has been added so delete it.

'Set up the mail merge type as mailing labels and use
'a tab-delimited text file as the data source.
.MainDocumentType = wdMailingLabels
.OpenDataSource Name:="C:data.txt" 'Specify the data source here

'Create the new document for the labels using the AutoText entry
'you added -- 5160 is the label number to use for this sample.
'You can specify the label number you want to use for the output
'in the Name argument.
oApp.MailingLabel.CreateNewDocument Name:="5160", Address:="", _
AutoText:="MyLabelLayout", LaserTray:=wdPrinterManualFeed

' oDoc.Compatibility (wdUseWord2002TableStyleRules)


'Execute the mail merge to generate the labels.
.Destination = wdSendToNewDocument
.Execute

'Delete the AutoText entry you added
oAutoText.Delete

End With

'Close the original document and make Word visible so that

'the mail merge results are displayed
oDoc.Close False
oApp.Visible = True

'Prevent save to Normal template when user exits Word
oApp.NormalTemplate.Saved = True

End Sub



Attached you will find two merged files. One is a Office 2003 Mail Merge, you'll notice 3 columns in the format of 5160, the second is what the solution above creates in Office 2007, notice 4 columns.

So is there a way to modify the code block above to tell Word to do the mail merge in 2003 Compatible mode?

Cell Numbering In Word 2007
i have 7 columns
and 98 rows

when i add numbers i each cell then it wil give me

1 2 3 4 5 6 7
8 9 10 11 12 13 14
and so on


but i want the numbers as follow

7 6 5 4 3 2 1
14 13 12 11 10 9 8
and so on

how can i create it in word 2007 ?



Edited by - Johnnyd1963 on 8/3/2008 8:48:46 PM

Word 2007 - Loop At Controls In Document
Hi,

I have to mention that this is my very first experience coding VBA in Word.

I have a word 2007 document which has many Checkboxes, Optionbuttons and Labels.

When I Check/Uncheck a checkbox, it has to set specific labels caption depending on their names.

In VB I loop at Me.Controls() and TypeOf label...

But I do not see that in Word.

I do not use à UserForm, I just use a Word Document.

Thank you for helping.

How To Hide Word 2007 Title Bar / Ribbon
Dear All,

We currently use word in our application. We hide the title bar of word and display it in a ActiveX control (just the textual area). We use the below API for hiding the title bar.

==============================================
Public Const GWL_STYLE = (-16)
Private Const GWL_PARAM = 394264704

SetWindowLong(mlngWordHwnd, GWL_STYLE, GWL_PARAM)
==============================================

It works fine with Word 98, 2000 & 2003. With Word 2007 the title bar is not getting hidden with the above API. It has a new concept called "Ribbon". It would be really useful, if any solution is provided for hiding the title bar & Ribbon from Word 2007.

Regards,
Suresh

How To Open/Read An Access 2007 (accdb) From Excel 2007
Hi All,

My company is moving to Office 2007. I am going through several hundred macros written in Excel 2003 to make sure they work in 2007.
I am trying to open and read an Access 2007 database (extension .accdb) from within Excel VBA.
What used to work was this:

Code:
Dim dbLocal as Database
Set dbLocal = Workspaces(0).OpenDatabase("C:MyDatabase.mdb")
When I run this under 2007 and change the Access database extension to .accdb, I get this error:

Quote:




Run TIme Error 3343
Unrecognized Database Format




I've tried adding extra References in, but no luck. Any help would be greatly appreciated.

Cheers,

Paul

Importing A Date Function From Excel 2007 To Access 2007
hi, I have a major project ahead of me, I am creating a Dbase full of maintenance records in Access 2007. This Dbase is supposed to be able to calendarise routine maintenance and also on-the-spot maintenance so that all our vehicles don't miss out on it. Is it necessary to link Access with Excel so that each time maintenance is performed, Excel tells Access when it needs to be done next time, or is there another way that's much simpler only using Access 2007? I'm new to Access and Visual Basic so simplest explanations are best...thanks in advance.

I Will Compensate For Any Help With A Macro Recording Issue I Am Having With Word 2007
Summary of my issue:
I have two tables in a document. I would need a macro button that would open another document and copy and paste those tables in it, in specific locations. Any help is very appreciated. I will pay for time. Email wgallo2337@aol.com

Enable/disable Custom Ribbom In Word 2007 Dynamically Using VBA
Hi All,

I am working on Word 2007 VBA. Am able to add Customized tab to the Word 2007 ribbon by using customUI.xml. However I would like to enalbe or disable some of the items on my cusotm tab dynamically thru VBA. Also I want to the customized ribbon item to be removed when I click a item.

Please advice me how I can accomplish the above mentioned task.

Regards,
Abhi.

CreateNewDocument Problem
I am using the CreateNewDocument function of the MailingList object in a VB .net application that works with office automation.
I am using office XP.
This function has changed from the one in Office 2K (two parameters added).
When i use this function on a client that has office XP installed everything works fine , if i use it on a client that has office 2000 it does not work. I don't have this problem for other functions that are the same between office XP and 2K.
How can i solve this problem without creating two different setups (that i also have to compile from 2 different computers...)???
Thanks for any hints..

Application.MailingLabel.CreateNewDocument
The problem is the line of code in the subject line, but why...

I had a VB file in word that would simply perform a redundant task of creating mailing labels, pulling the information from an Excel spreadsheet.

After the machine I ran this on was upgraded (Finally) from windows 98se to 2000 it started hosing up... Now when I run the macro and it hits the line of text in the subject, it creates a micro document with a column of 4 labels on it. The macro should create a sheet of 30 standard Avery 5160 labels. The page it creates is 4.13" x 5" rather than 8.5x11.

If I do the same process manually it works. If I record it as a macro it works as I do it manually but when I run the macro it makes the page small... Why the change, what happened?

Also as a bonus question: I have an excel macro, and a word macro. I would like to make the word macro call and complete the excel macro then complete its own tasks... Can I do that/how?

Thanks
WW

Routing In 2007
I know that the feature was removed from the menus but the MSDN says the method is still available.
http://msdn.microsoft.com/en-us/library/bb177975.aspx

So I route something and then I have a button for when the next person opens it that is just:


Code:
awname = ActiveWorkbook.Name
Workbooks(awnamee).Route
I have also tried ActiveWorkbook.Route and ThisWorkbook.Route

Now this works fine in 2003 but in 2007 the method fails with a 1004 error I believe.

Any suggestions?

VBA For Access 2007
Hope this is the right forum. I have a lot of VB experience, but am new to VBA, especialy Access 2007.

Have managed to create my tables, and an initial form, but I need a head start as to how to write some VB code. And to have access to a toolbox to add controls to the form. Once that is known to me, the next thing is how to perform SQL statements against the host DB.

Office XP Vs 2007
SCENARIO
Some years (2004) ago I developed some macros (forms, modules, etc) to automate some proceses using Word 2002, Excel 2002 & Access 2002. The programs used to run in a PC with Office XP, now the there is a new PC with OFFICE 2007 instead.

THE PROBLEM
Seconds after the macro starts running it stops with the msg
"Code excecution has been terminated" I click on debug and run the macro with F8 and no error is found

THE QUESTION
Why would the macro stop if no error is ecountered (and no one has press Ctrl+Break as the so useful help indicates is the cause of the problem)?

New Excel 2007
I have a VB app that reads MS Excel files and imports selected fields into an access database.

Some of my clients have upgraded to the new Excel 2007. What do I need to do within VB to ensure that the 2007 files can be read and processed?

TIA for your assistance.

jDadWilson

Outlook 2007
I have been sending emails daily, from my production system, using a VB6 app with a package called HTML Mailer Plus. Suddenly, mu customers are telling me that they are not receiving their daily email. The only change that I can see is that I upgraded from Outlook 2003 to Outlook 2007. I am assuming that HTML Mailer does not work with Outlook 2007, even though I get no error mesages.

My project does reference MS Office 12, where before it was version 11.

So, I guess now is the time to break away from 3rd party code. I am going to try this code:

Dim olapp As Object
Dim oitem As Object


Set olapp = CreateObject("Outlook.Application")
Set oitem = olapp.CreateItem(0)
oitem.Subject = "Daily Activity Report"
oitem.To = "fred@flintstone.com; "
oitem.Body = "Attached is the Daily Activity Report"
oitem.AttachFile ("Z:DADFaxesFax49.txt")
oitem.Send
olapp.Close
Set olapp = Nothing
'==========================

Do you see any reason why this will not work with Outlook 2007?


===edit

This is the old code

Dim objMailer As New FlexiMailer

objMailer.ConnectToServer ("smtp.hbci.com")
objMailer.From = "brendaanderson@technigraph.net"
objMailer.Subject = "Daily Activity Report"
objMailer.Body = "Attached is the Daily Activity Report"
objMailer.AttachFile ("Z:DADFaxesFax2.txt")
objMailer.AddMultipleRecipients fmTo, "fred@flintstone.com"
objMailer.SendMessage
objMailer.Disconnect
Set objMailer = Nothing


== more edit

it does not oitem.From and oitem.Attachfile. I get 'object doesn't support this method' errors. Argh...

Access 2007 VBA
Does anyone know of a link to where I can get started with Access 2007

Wha-a-a-a-t Is The Office 2007...
...object procedure--using VBA--for grabbing a chart that Excel has dumped onto the sheet after creating it and, after activating that ChartObject:

1. expanding the base chart object in the horizontal and vertical dimensions?

2. moving the chart object to another part of the same sheet?

(The whole object model has changed, and MS doesn't seem to have at the least even documented how the resizing and same-sheet moving is done. The capacity for that may not even be preserved from pre-2007.)

(By the way, the Office 2007 UI is a catastrophe.)

Thanks in advance.

Access 2007
I have a 2007 access database that I need to share between three users simultaneously and updated accordingly. I have loaded the database on a remote server and created shortcuts on the entire three users desktop. However, when more that one user is accessing the database our software crashes… can anyone help me out with this please!

Excel 2007
I am fairly new to VB and the person who first created the program used it through the same database but used Excel 2003. I am using the same database but except have Excel 2007. Are there any major codeing issues that arise from using 2007 rather than 2003?

Any help will be great!!

DAO And Access 2007
I have an older application that uses access 97 and DAO. Is there one option to use access 2007 or access 2003 using DAO ? to use ADO is necesary rebuild all application.
Thanks in advance
 
Fernando Oviedo Find a local pizza place, movie theater, and more….then map the best route!

Excel 2007
Hi,

I encountered a problem and I was hoping I can get some help. I am using a complicated program that was
build using VB.NET 2002 version and Excel 2003. Now I installed Excel 2007 and I get
"Can not create ActiveX component" - related to the following line

XlApp = CType(CreateObject("Excel._ExcelApplication"), Excel._ExcelApplication)

I have no idea what to do, I am not even sure if the syntax is correct (although is not complaining)

I changed some of the references but still is not working. One thing caught my attention:
In the original code, before I made the modifications, I had a reference called, simply, "Office" (among others).
Now I have all the others (the new versions I hope) but no "Office". I am not a master in VB anyway, so I am lost.
Can anyone please help?

Thanks,
Andrei



Edited by - andrei_popa17 on 11/26/2007 5:29:26 PM

2007 Vs XP/2003
Wondering, if there's a compatibility between them?
Tool, which I coded in Access XP, and which was working under Access 2003, didn't work (it was because of the missing FileSearch property of Application object, which is strange as Access 2007 mentions Application.FileSearch in its help)...

Any comments?

Did anyone spot any other differences?

-----------------------------------------------------------------
Making mistakes is one of the ways of improvement.
GL and HF

Edited by - un5killed on 3/16/2007 6:21:17 AM

Access 2007 With VB 6.5
Hello,
first off, thank you for taking the time to read this. Second, I am trying to modify the parameter of a query created through design view. I want to physically change the query parameter so that if I were to open up the design view it would have the new parameter data.
I have looked everywhere and it seems that this question comes up a lot, but I can't seem to find a viable answer that works.
Thank you again for your time,
Phreakuency

Problem With 2007 Excel
My company is transitioning from 2003 to 2007 Excel and I am now having a problem with a line of code that I have not had with the older version.

I have program "A" (as I will refer to) opening a CSV file full of data and copying any number of lines chosen by the operator to a master file which I will refer to as program "B" (WSmaster).

TotalParts(I) = Cells.CurrentRegion.Rows.Count
Rows(TotalParts(I) & ":" & TotalParts(I) - NumPartsPick + 1).Copy
**As u can see I highlight the WHOLE row or number of rows in program "A" above after pulling the data into program "A" from the csv file

WSmaster.Activate
Sheets(Blockhead & "op" & OPCODE + I - 1 & PRGLNTH).Select
Rows("8:8").Select
With Selection
Selection.Insert Shift:=xlDown 'This line no longer runs!!
End With
**I then activate program "B", select row 8:8 and when it gets to the insert line it errors out saying that the copy area and paste areas are not the same shape (runtime 1004). BUT they ARE!? I'm trying to paste the whole row after highlighting and copying the whole row. Even trying this manually yields the same error. It seems to me that this may be a glitch.

Please advise
Pnut

Removing An Excel 2007 Add-in
I imported an Excel 2003 .xls and saved it in Excel 2007 as an .xlsm and .xlma

Since the .xls had a toolbar attached, the tools from the toolbar show up under the add-ins tab in Excel 2007. Now I would like to remove the .xlma file and get rid of this add-in. I can't seem to do it though.

If I goto Options>Add-Ins, I can see the path is:
c:usersjoeAppDataRoaming ..... oolbar.xlam

using exlporer, I cannot see the AppData beyond c:usersjoe

So what do I do now. Why can't I see AppData with explorer.

Is there an easier way to do this?

Excel 2007 VBA Question
For use in Excel 2007 VBA, is there a similar statement I could use to mirror what #region - #end region statements do in Visual Studio?

Thanks for your help!

Problems With Excel/VBA 2007
I have a spreadsheet with macros that worked fine with Excel 2003. Now when I open the spreadsheet I get the following:

"Excel found undreadable content in ... Do you wish to recover contents ..."

To which I reply Yes. Then I get:

Removed Records: Sorting from /xl/worksheets/sheet2.xml part

Then after I save the sheet, exit, and try to reopen it, I get the same thing all over again.

Any ideas what is going on and how I can get rid of this annoyance?

Thanks,
JoeK

Switching Between 2003 And 2007
I have version 2003 and 2007 installed.
The active version is the one that is installed the latest.
Probably a registry setting.
Can someone tell me what registry key is responsible for this ?

Excel 2007 PageSetup
Apparently the .PageSetup options have dramatically changed in Office 2007...

Im using a program i wrote which exports data to Excel and worked fine in non 2007... but these options

With oExcel.Worksheets(1).PageSetup
.HeaderMargin = 0
.FooterMargin = 0
.TopMargin = 0
.BottomMargin = 0



etc... no longer work... i don't know if they need to be set a different way, if the worksheet is somehow locked or what... the auto list also does not list any of the PageSetup properties.... can anyone help me here....

im editing this but leaving what ive previously wrote... apparently when exporting the excel object from visual basic into office 2007 most of the page layout optoins are locked... therefore causing routine failure... gay

VB6 And Access 2007 Problem
Hey everyone.

I am having an issue. I am able to save information to an access table, however, it will not move to the next empty record, for the next save.

When I load the form, it will pull the information from the previous save. If I clear the fields and save something new, it will place the new information on top of the old. What am I doing wrong or what do recommend that I do. Here is the simple code I wrote. Using ADO.

Private Sub cmdJEntrySave_Click()

Dim boolAdding As Boolean

boolAdding = (datJournalSave.Recordset.EditMode = adEditAdd)

datJournalSave.Recordset.Update
If boolAdding Then
datJournalSave.Recordset.MoveLast
End If
End Sub

Any help would be kindly appreciated. Thanks!

VB6 - Access 2007 Problem
Hello all, im fairly new to vb
i doubt this problem will be a problem for any of you lol.

i have this simple stock inventory program and would like to add a combobox to a field so i can filter the datagrid.

any ideas where i been going wrong?

[edit]
the database is saved as a 2000 version

hmm

when i create a new database VB always says it cannot recognise the database format, but when i edit a DB that came with VB and stip it down to 1 table then rename it, it works fine. Any ideas?

Provider For Access 2007
What kind of database provider am I going to use if Im using Microsoft Access 2007 as my database.. Thanks

Connecting To Access 2007 Using ADO
Hello All,

I have been trying to connect to Access 2007 using ADO and found out that the reason I could not was because of the .accdb extension vs .mdb.

So after some reseach I found the correct connection string:

vb Code:
DBConn.ConnectionString = "Provider = Microsoft.Ace.12.0;Data Source=" & strPath & ";Persist Security Info=False"


But now I get the error 3706 "provider cannot be found or not installed properly.

So after some more research I found that the connection uses the Ace.12.0 OLEDB vs the Jet.4.0 OLEDB.

I found a database connectivity download from MS which is suppose to contain the Ace.12.0

Am I on the right track here? is this the download that I need? has anyone else had this issue?

Thanks.

The Basics Access 2007
Not sure what my problem is, maybe it's just too early in the morning. I have worked with access db's before but never Access 2007. Maybe I'm missing something that is different but not finding any info.

Can someone please post a simple connect, insert, and select. I just need to make sure my formatting is correct though I have checked. It connects just fine but when I attempt to insert the error it returns object required.

I'm just using a test db with 3 fields ItemID, FName, Reason.

dBase.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:TestDB.accdb;Persist Security Info=False;"

Dim strSQL As String
strSQL = "INSERT INTO DataTable (ItemID,FName,Reason) Values (123456789, Bob, Just Because)"
dBase.Execute strSQL

I'm fairly certain this is what I have always used in the past with 2000 db.

CommandBars In Excel 2007
Hello,

I'm wondering if somebody could help me with a problem on CommandBars in Excel 2007. I have a code that add a RMC control item to a shape:

If Not Application.CommandBars("Shapes").Controls.Item(1).Caption = "Show Bus Connections..." Then
With Application.CommandBars("Shapes")
With .Controls.Add(Type:=msoControlButton, before:=1, Temporary:=True)
.Caption = "Show Bus Connections..."
.OnAction = "GrowBusDiagram"
.BeginGroup = False
.Visible = True
End With
End With
End If

This code works fine with Excel 2003, but doesn't in 2007. Is there any easy way to make it work for 2007?

Thanks a lot,
Julia

MSAccess 2007 Corruption
One of our program which is in all the computers( having different operating system ) has accdb file as backend database. Multiple operations such as saving, deleting, adding etc. are done simoultaneously. During this the database gets corrupted periodically resulting in unrecodnised database format error or records having #ERROR and loss of data. If we compact and repair the database we loose the precious data.

The product is developed using microsoft visual basic 6.0 and our development team put in regorous effort in finding out the cause to the problem and hence came out with certain solutions such as closing the connection, having a primary key etc which didn't help much in solving the problem and our hardware team has examined the network and found no problem.

Please let us know how to avoid this problem occuring time to time.

VB Errors In EXCEL 2007
A spreadsheet application written in EXCEL 2003 using the visual basic editor in EXCEL runs fine. When taking the same application to EXCEL 2007, errors relating to Range and Select occur. The same errors occur whether EXCEL 2007 is running under XP or Vista. When stepping through the program using the F8 key, the errors don't occur. Running in a normal fashion, the errors occur. The security level is set LOW and Windows Classic is the theme. Any ideas what may be happening?

Excel 2007 - Button Name
I have a chart on a sheet that has some buttons to which macros are assigned. I need to reposition the buttons occasionally. In Excel 2003, the buttons were treated as 'shapes' and I could simply run through all the shapes, find the button in question by its name, and move it. Excel 2007 apparently does not treat the button as a shape. How can I find the particular button (e.g. name is "Do Something") in question? Here's the code I have been using. When I execute it in Excel 2007, I get a 'not found' error.


HTML Code:

ActiveChart.Shapes("Do Something").Left = 450


Thanks.

How To Create An DSN For MS Access 2007?
How to create an DSN for MS Access 2007 ?

--------------------------------------------------------------------------------

Hi all,

How to create a DSN programmatically for MS Access 2007 ?

i have tried the following code,but its not working.

------------------------------------------------------------------------
Function Build_SystemDSN(DSN_NAME As String, Db_Path As String)

Dim ret%, Driver$, Attributes$

Driver = "Microsoft Access Driver (*.mdb,*.accdb)" & Chr(0)
Attributes = "DSN=" & DSN_NAME & Chr(0)
Attributes = Attributes & "Uid=Admin" & Chr(0) & "pwd=" & Chr(0)
Attributes = Attributes & "DBQ=" & Db_Path & Chr(0)

ret = SQLConfigDataSource(0, ODBC_ADD_SYS_DSN, Driver, Attributes)


'ret is equal to 1 on success and 0 if there is an error
If ret <> 1 Then
MsgBox "DSN Creation Failed"
End If

End Function

--------------------------------------------------------------------------

So, pls help me to do that!

i need it urgently.


Thanks,

th.

Access 2007 And VB 6.0 - Report !!!
Wishing you all !!!!

* I have report in Access 2007
* I am using VB 6.0 for open that report
* By the following code i am getting "User-defined type not defined" error on

Code:
Private Sub Command1_Click()
Dim objACCESS As ACCESS.Application


* My code is


Code:
Option Explicit
Private Sub Command1_Click()
Dim objACCESS As ACCESS.Application
On Error Resume Next
Set objACCESS = CreateObject("Access.Application")
objACCESS.OpenCurrentDatabase "D: est.mdb"
objACCESS.Visible = True
'DoCmd.OpenReport "tabel2", acViewPreview
'DoCmd.Maximize

objACCESS.DoCmd.Maximize
objACCESS.DoCmd.OpenReport "PID", View:=acViewPreview
objACCESS.DoCmd.Maximize

End Sub


* Please advice on this
* Thanks in advance.

Is VB6 Compatible With Office 2007?
Hello, I was wondering if VB5/6 is still compatible with the latest version of MS Office, i.e. Office 2007. In other words, I would like to know if it is still possible to reference Word or Excel using the late binding as we could do with Office XP or 2003.

So, do you know if code like the one below (NB: it is only an example and it is incomplete) still works with Office 2007?


VB Code:
MyText = Trim(txtLetter.Text)    WApp.ActiveWindow.Selection.ParagraphFormat.Alignment = 1    WApp.ActiveWindow.Selection.InsertAfter MyText     WApp.ActiveWindow.Selection.InsertParagraphAfter    WApp.ActiveWindow.Selection.Font.Name = "Arial"    WApp.ActiveWindow.Selection.Font.Size = 10    WApp.ActiveWindow.Selection.Font.Bold = True    WApp.ActiveWindow.Selection.EndOf


Thank you in advance.

2007 Access Database
I have a 2007 access database that I need to share between three users simultaneously and updated accordingly. I have loaded the database on a remote exchange server and created shortcuts on the entire three users desktop. However, when more that one user is accessing the database our software crashes… can anyone help me out with this please!

VB 6 With Excel 2007 Error
Installed VB6 application on user's PC which runs MS Office 2007.  Application tries to produce an excel file.  I get "Run-time error '1004', Method '~' of object '~' failed"
when trying to save excel file in format "xlExcel9795".
(See ** for code that causes the failure.)
fyi - this code works with previous versions of Excel.

  If OpenExcel = True Then
    With xlApp
      .ActiveWindow.ScrollColumn = 1
      .Cells.Select
      .Selection.Columns.AutoFit
      .Range("A1").Select
       strMsg = "(5) After Last Column/Row! "
 **     .ActiveWorkbook.SaveAs FileName:=strYEApath,
 **        FileFormat:=xlExcel9795, CreateBackup:=False
    End With

Is there another FileFormat I should be using?  Is there something I need to set/change in Excel 2007?  Is there some  kind of download that would fix this?

TIA,


Copyright © 2005-08 www.BigResource.com, All rights reserved