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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BO Macro to include active and inactive document.

Status
Not open for further replies.

jabedin

Programmer
Feb 24, 2004
37
AU
Hi there,
I have a Business Object VB macro which runs a document everyday. After finishing the process, I want to send this document through automatic email along with one other document which was run before. If I run this macro while in business object, it's working fine. But when I submit this in the schedular, it sits there for ever. The problem, I can see, the inactive document which I want to attach with this.

If anyone know how to attach the inactive document (which is sitting in my pc) along with the active document and can help me with will be highly appreciated.


Best Regards
Jay
 
how is it "sitting" in your PC ?

is it on a hard drive? in the repository?

If it is on the hard drive, just reference it:

set myDoc = Documents("Full Path & Filename").open
myDoc.Send
myDoc.close(false)

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Hi Geoff,

Thank you very much for the reply.
I have to put this into BO schedular to run every day which I believe is in repository.

I gaze the problem is when this is running from the repository at certain time of the day, it can't identify my c:\xxx directory where I want to save the file. This macro is running fine(create files, attach files) when I am running it within the document from Macro by VB stepin.

If I can find a way to identify my pc from BO repository after finishing the job, I think will solve the problem unless there is other way.

Thanks once again and will highly appreciate in further information regarding this.

Best Regards
Jay
 
If you want the BCA to write to your PC, you have to specify a full UNC path: \\computer_name\share_name

The Server doesn't even know your computer exists by drive letter. Also mapping a drive on the server won't help as the services don't recognize mapped drives.

Steve Krandel
Symantec
 
Hi Steve,

Thanks for the reply. I think I need exactly what you said. Do you have a sample couple of line code somewhere?

I will highly appreciate that.

Regd
Jay
 
presumably you already have the saveas code - just amend the file path to be the full UNC pathfor your position on the network

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Hi Geoff,

Your advise is highly appreciated. I have got my machine address ready now and I wish this is going to work.

Thanks.
Jay
 
Hi,

Thanks guys for your help. It's working. Saving the files and picking active and inactive(created in a separate run) files in email attachment. I am having a bit of problem when adding multiple attachment. It's send more that one email. My code is like as belows

Msg.AddAttachment ("\\A0000001\Jay\" & repName & ".pdf")
Msg.AddAttachment ("\\A1000001\Jay\BK.xls")->INACTIVE FILE

Interestingly this work fine when sending active document save as different type(ie pdf,xls).

Thanks for your help once again and will appreciate if someone has some expertise with my latest issue.

Regards
Jay
 
Hi Steve/Geoff,
It's all working fine now. Thanks a lot for your help.

Regards
Jay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top