Solved

Upload a document from MS Word ?

Posted on 2002-05-08
7
173 Views
Last Modified: 2013-11-13
How can I carete a macro or add-in in VB, so it will
allow me to upload a doc from MS Word to a particular
web sever ?

I know I can do it in ASP, but I just want to try this in MS Word.
0
Comment
Question by:tanc02
  • 3
  • 2
  • 2
7 Comments
 
LVL 1

Author Comment

by:tanc02
ID: 6996346
Any Code ?
0
 
LVL 3

Accepted Solution

by:
daffyduck14mil earned 200 total points
ID: 6996559
Hi,

In your template file, you can add a userform and load up an extra control, namely the "Microsoft Internet Transfer Control". You can then use all the properties and methods of this control to upload your file. This enables you to make a document that can save and send itself to, for example, an FTP site.

The code is real easy too, just use the execute method of the Inet control. For example, the following line sends the file C:\Temp\test.txt to the server kobaltnt_5 with the name test.txt in the root:

Inet1.Execute "ftp://kobaltnt_5", "put C:\temp\test.txt test.txt"

Off course you need some other code too, for error handling, and perhaps some additional things you might want to do. But basically this is it. Easy as the proverbial pie.

Grtz.©

D.
0
 
LVL 3

Expert Comment

by:Diveblue
ID: 6996889
Great if it works, but the Inet control is known for being buggy. I prefer to make the wininet calls directly (all code, no controls) let me know if you need the source code for the api calls.

scott
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 3

Expert Comment

by:daffyduck14mil
ID: 6996906
:) Can you name me one product that MS made that isn't buggie? Almost everything contains bugs. It's the amount of damage or affect that must count. Just my view on this. :)

"If it doesn't fit, use a bigger hammer."

Grtz.©

D.
0
 
LVL 1

Author Comment

by:tanc02
ID: 6996924
Can I use winsock control ???
0
 
LVL 3

Expert Comment

by:Diveblue
ID: 6997521
The problem with using any control is that you need to distribute the control to each user & register it on the machine.
0
 
LVL 3

Expert Comment

by:Diveblue
ID: 6997522
The problem with using any control is that you need to distribute the control to each user & register it on the machine.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
This video teaches viewers about errors in exception handling.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now