Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with saving of a document......

Status
Not open for further replies.

grobbu

Programmer
Jun 25, 2002
40
BE
Hi there

This is the end of a function.....I Try to save the location of my word document in an access table.....my problem is that it mostly works ...but sometimes not....anyone has got an idea.....More details...just ask....

tnx


.ActiveWindow.ActivePane.Close
.ActiveWindow.ActivePane.View.Type = wdPageView
.ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
.Selection.EndOf unit:=wdParagraph, Extend:=wdMove
.Visible = True
'----------------------------------------
'Het Word-window wordt gemaximaliseerd -
'----------------------------------------
.WindowState = wdWindowStateMaximize
.Activate
'--------------------------------------------
'- Bepalen van de bestandslocatie en naam -
'--------------------------------------------
.ActiveDocument.SaveAs Chr$(34) & TotaleFilePath & Chr$(34)
.ActiveDocument.Saved = True
.Activate
End With
End Function
 
Looks like you should be in the Word forum rather than the Access forum.
-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
No scking.....not to the word forum....
I haven't got a problem with anything in word...works perfect....
But the location of my word files should be saved in a table.....and that ain't working always......that's the problem....

And i've been testing in debugging for days now.....Just don't know it.......

greetz....
 
What I should have said a little more clearly is that the code you have posted is automation code for Word. As this is an Access forum it may be better for you to post it in the Word forum. I can't tell from the posted code whether it's Word code in Word or Word code in Access (automation).

The part that is confusing to me is where you say that it mostly works and I don't see anything in the code that would allow that to happen.

Towards the end you use the Word commands to save the file with the filename string variable 'TotaleFilePath'. When I preceed your code with:

Dim TotaleFilePath As String
With Documents(0)

I can compile it in Word.
If you want to save it is Access you would need to:
From Access:
1) Use TotaleFilePath variable in an INSERT SQL statement.
2) Open a recordset and use the .AddNew method.

From Word:
1) Open the database tables using DAO or ADO recordsets and add the variable TotaleFilePath.


-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top